You Have To Know: Release 2
You Have To Know: Release 2
Color:
You have to know
You may want to know
Code
Tips
That's the common text
Picture 2
Github on ubuntu in Chinese is not very good,you can take a look “Picture 2”.There are 50%
Chinese and 50% English(Maybe 60%?).
You can use this command to install something you need:
apt-get install build-essential u-boot-tools uboot-mkimage gcc-arm-linux-gnueabihf
ncurses-dev -y
Then “cd” to linux-sunxi directory:
cd linux-sunxi
Use sun7i(A20) config:
make sun7i_defconfig ARCH=arm
Then select something you want:
make menuconfig ARCH=arm
If all OK,it will show you something like picture 3.
Picture 3
mv arch/arm/boot/uImage output
Then,cd to output:
cd output
You have to remove links of source code in output files or you want to copy them to your
board:
rm lib/modules/*/build lib/modules/*/source
Build U-boot
U-boot is a kernel-booter like grub,if you are using windows,it likes bootmgr or ntldr.
Let's build it now.
Download files from github:
git clone https://github.com/linux-sunxi/u-boot-sunxi -b wip/a20
Aha,it's faster because it's smaller than linux kernel.
Then.cd to u-boot-sunxi directory
cd u-boot-sunxi
You can edit include/config_cmd_default.h to add something,it's useful
For cubieboard1:
make cubieboard ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
For cubieboard2/cubieboard3(cubietruck):
make cubieboard2 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
Write it:
dd if=spl/sunxi-spl.bin of=/dev/sdb bs=1024 seek=8
dd if=u-boot.bin of=/dev/sdb bs=1024 seek=32
mkfs.vfat /dev/sdb1
WARNING TOO,PLEASE REPLACE SDB TO SDC IF YOU HAVE 2 HARD DISKS ON YOUR
COMPUTER
Build script.bin
script.bin is a config file.
You can use these command to build it:
apt-get install libusb-1.0-0-dev libusb-dev -y
git clone https://github.com/linux-sunxi/sunxi-boards
git clone https://github.com/linux-sunxi/sunxi-tools
cd sunxi-tools
make
mount /dev/sdb1 /opt
./fex2bin ../sunxi-boards/sys_config/a20/cubieboard2.fex /opt/script.bin
cd ..
Build rootfs [Choose one from three systems]
BusyOS
Do you know busybox?May not,ok,that's a light linux program,all of the commands
but busybox make a link to busybox program.It means you type cd,then it run busybox's
cd.Run init is run busybox too.You will say,what a stupid guy,why he makes this.And I will
tell you,because many program use some same codes.But many program means many
same codes,so he decides to make this program,it's more light than common linux like
debian,but it supports dpkg(not apt-get)!Openwrt,dd-wrt and TP-Link wirless router are using
it too[TP-Link's router's busybox dosen't have ls!you can visit
http://see.sl088.com/wiki/WR703_%E5%AE%98%E6%96%B9%E5%9B%BA%E4%BB
%B6/TTL%E7%99%BB%E9%99%86 to take a look].
OKOK,let's start.
First,download busybox:
wget http://busybox.net/downloads/busybox-1.21.1.tar.bz2
tar jxvf busybox-1.21.1.tar.bz2
cd busybox-1.21.1
make menuconfig ARCH=arm
Then,set busybox settings → build option → Cross Compiler prefix to
“arm-linux-gnueabihf”
And:
make
make install
If success:
mount /dev/sdb2 /mnt
cp -Rv _install/* /mnt
cp -Rv examples/bootfloppy/etc /mnt
cd /mnt
mkdir dev proc sys var home tmp mnt run boot boot2 dev/pts
Then,remove and edit fstab
rm etc/fstab;nano etc/fstab;chmod 777 etc/fstab
Enter:
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
tmpfs /tmp tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
/dev/mmcblk0p1 /boot2 vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
Debian
First,install debootstrap:
cd /mnt
bootm 0x48000000
And cd,build:
cd /opt
Then umount:
apt-get install cu -y
cu -s 115200 -l /dev/ttyUSB0
OR use minicom:
#Exit
OR use screen:
Aha~ash~