Article Directory
prologue
Environment Ubuntu18.04
+Windows7
This article mainly refers to NanoPi M2/zh wiki documentation
Install cross compilation tool chain
Clone the cross compilation toolchain
git clone https://github.com/friendlyarm/.git -b master --depth 1
//or
git clone https://gitee.com/friendlyelec/prebuilts.git -b master --depth 1
Unzip
cd prebuilts/gcc-x64
cat toolchain-4.9.3-armhf.tar.gz* | sudo tar xz -C /
After decompression, the following files are generated
Add PATH
vi ~/.bashrc
vi
The operation is not explained, if you don’t understand, check the vi command summary by yourself , add the following command
export PATH=/opt/FriendlyARM/toolchain/4.9.3/bin:$PATH
export GCC_COLORS=auto
Execute it to make it effective immediately
. ~/.bashrc
Verify that the installation was successful or failed
arm-linux-gcc -v
U-Boot
U-Boot download & compile
Links are provided by the official github
, the download speed is very slow.
I used the github
import gitee
process, the following direct cloning warehouse on it.
git clone https://gitee.com/jyu_hsy/uboot_nanopi2.git
Speed is still possible
that the project is already the default branch nanopi2-lollipop-mr1
, and therefore do not need to perform git checkout
the replacement branch, execute the following command:
make s5p4418_nanopi2_config
make CROSS_COMPILE=arm-linux-
Generate after completion u-boot.bin
U-Boot update to NanoPi M2
We need fastboot
to update the running NanoPi M2
board SD
of theU-Boot
Can be installed by the following command fastboot
tools
sudo apt-get install android-tools-fastboot
Back to the Window
screen displayed, use SecureCRT
to log in toNanoPi M2
Powering on the 2s
inner (reset to restart on the line), a terminal press enter into the u-boot
command mode
In the u- boot
Enter the command line fastboot
to enter the fastboot
mode
is turned on Ubuntu
, execute the following command
fastboot flash bootloader u-boot.bin
There is a pit here, after executing the above instructions, it has been stuck waiting for device
Whether experiencing this problem, please check the virtual machine enabled USB控制器
and added equipment
Recommended here it is USB1.1 控制器
if you're like me to use Oracle VM VirtualBox
, do not directly add an empty value USB筛选器
, so after starting the virtual machine, the mouse and keyboard all been taken over, only to restart, not a joke.
Compile Linux kernel
Prepare mkimage
Compile the kernel need to use U-Boot
the toolsmkimage
You can directly use the following instructions to install:
sudo apt-get install u-boot-tools
Before git
down uboot
actually have this tool
Use the following commands to compile and install:
cd uboot_nanopi2
make CROSS_COMPILE=arm-linux- tools
sudo mkdir -p /usr/local/sbin && sudo cp -v tools/mkimage /usr/local/sbin
After performing the above operations, it can be found /usr/local/sbin
in the presence ofmkimage
Download kernel src
git clone https://github.com/friendlyarm/linux-3.4.y.git
//or
git clone https://gitee.com/ezio_zhang/linux-3.4.y.git
cd linux-3.4.y
Compile the Debian kernel
make nanopi2_linux_defconfig
touch .scmversion
make uImage
Compile a little longer, be patient, after completion of the translation can be found the path to uImage
the file
Replace the kernel
Remove SD卡
with a reader to read, and add the USB device, then Ubuntu
appears on the desktop boot
and rootfs
file (on hand this SD卡
has mirrored the official burnt, may be a bit different), we will be generated uImage
to move them.
Afterword
Wiki's tutorials come to an abrupt end, but the mirroring is not over!
I found another wiki document NanoPi / zh Wiki document
We also need transplants can find Debian
the file system, and then make SD卡
.
According to this tutorial is SD卡
to burn NanoPiM2
not start properly, it may be a non-tutorial warehouse NanoPiM2
used ...
to temporarily leave the pit, finished.