编译u-boot-sunxi

 

下载u-boot-sunxi源代码:

git clone -b sunxi https://gitee.com/joyce3800/u-boot-sunxi.git

查看支持有哪些开发板:

nano boards.cfg

选择自己的开发板:

make sun4i_config CROSS_COMPILE=arm-linux-gnueabihf-  ARCH=arm

编译代码:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 all

生成目标文件:

u-boot-sunxi-with-spl.bin

如何放入SD卡内?

Legacy SD card layout
start    sector    size    usage
0KB    0    8KB    Unused, available for MBR (partition table etc.)
8KB    16    32KB    Initial SPL loader
40KB    80    504KB    U-Boot
544KB    1088    128KB    environment
672KB    1344    128KB    Falcon mode boot params
800KB    1600    -    Falcon mode kernel start
1024KB    2048    -    Free for partitions

 

烧写u-boot到SD卡。

    1、给SD卡分区,尽量使用8GB以上的大容量卡,后面安装ubuntu根文件系统需要。给内核文件分8M空间,其余空间留给根文件系统。(如果插上后自动挂载,记得先卸载!)

复制代码
sudo fdisk /dev/sdb
d
n
p
1
2048
+8M
n
p
回车
回车
t
1
b
t
2
83
w
复制代码

    2、格式化分区。

sudo mkfs.fat /dev/sdb1
sudo mkfs.ext4 /dev/sdb2

    3、烧写u-boot到SD卡中。

sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
posted @ 2021-01-29 13:42  joyce3800  阅读(409)  评论(0编辑  收藏  举报