Make your own Debian mirror for NanoPi M2

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
Insert picture description here

Add PATH

vi ~/.bashrc

viThe 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

Insert picture description here

U-Boot

U-Boot download & compile

Links are provided by the official github, the download speed is very slow.

I used the githubimport giteeprocess, the following direct cloning warehouse on it.

git clone https://gitee.com/jyu_hsy/uboot_nanopi2.git

Speed is still possible
Insert picture description here
that the project is already the default branch nanopi2-lollipop-mr1, and therefore do not need to perform git checkoutthe replacement branch, execute the following command:

make s5p4418_nanopi2_config

make CROSS_COMPILE=arm-linux-

Insert picture description here
Generate after completion u-boot.bin
Insert picture description here

U-Boot update to NanoPi M2

We need fastbootto update the running NanoPi M2board SDof theU-Boot

Can be installed by the following command fastboottools

 sudo apt-get install android-tools-fastboot

Back to the Windowscreen displayed, use SecureCRTto log in toNanoPi M2

Powering on the 2sinner (reset to restart on the line), a terminal press enter into the u-bootcommand mode

In the u- bootEnter the command line fastbootto enter the fastbootmode
Insert picture description here
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 控制器
Insert picture description here
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.
Insert picture description here
Insert picture description here

Compile Linux kernel

Prepare mkimage

Compile the kernel need to use U-Bootthe toolsmkimage

You can directly use the following instructions to install:

sudo apt-get install u-boot-tools

Before gitdown ubootactually 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/sbinin the presence ofmkimage
Insert picture description here

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

Insert picture description here
Compile a little longer, be patient, after completion of the translation can be found the path to uImagethe file
Insert picture description here

Replace the kernel

Remove SD卡with a reader to read, and add the USB device, then Ubuntuappears on the desktop bootand rootfsfile (on hand this SD卡has mirrored the official burnt, may be a bit different), we will be generated uImageto 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 Debianthe file system, and then make SD卡.

According to this tutorial is SD卡to burn NanoPiM2not start properly, it may be a non-tutorial warehouse NanoPiM2used ...
Insert picture description here
to temporarily leave the pit, finished.

Guess you like

Origin blog.csdn.net/weixin_40774605/article/details/105552124