linux 内核裁剪之 uboot

步骤

准备工作

下载地址

1
https://ftp.denx.de/pub/u-boot/u-boot-2023.04.tar.bz2

编译

1
2
make vexpress_ca9x4_defconfig
make -j$(nproc)

测试

qemu 加载 uboot 需要用 elf 的格式

bin 格式的没有入口点,适合烧录到板子上

1
2
3
4
5
qemu-system-arm \
-M vexpress-a9 \
-m 512M \
-kernel ~/downloads/u-boot-2023.04/output/u-boot \
-nographic

调试

查看变量

1
printenv xxx

手动执行,比如你定义了 bootcmd

1
run bootcmd

重启

1
reset