交叉编译Cubietruck的u-boot

1.下载u-boot源码 

mkdir cubietruck

cd cubietruck

git clone https://github.com/linux-sunxi/u-boot-sunxi.git

2.编译:
export CROSS_COMPILE=arm-linux-gnueabihf-
make distclean
make Cubietruck_config
make clean
make
编译完成以后,在当前目录下生成u-boot-sunxi-with-spl.bin和u-boot.img。

3. 分区并格式化sd卡
sudo fdisk /dev/mmcblk0

sudo mkfs.ext2 /dev/mmcblk0p1

4. 把u-boot镜像刷入sd卡 (见http://linux-sunxi.org/Bootable_SD_card)
sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=1
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
sudo dd if=u-boot.img of=/dev/mmcblk0 bs=1024 seek=40

你可能感兴趣的:(OpenWRT)