> For the complete documentation index, see [llms.txt](https://dev2ero.gitbook.io/notes-cs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev2ero.gitbook.io/notes-cs/practice/bian-yi/buildroot-bian-yi-arm-target.md).

# buildroot 编译 arm target

报错：

```
boot/uboot/uboot.mk:451: *** No board defconfig name specified, check your BR2_TARGET_UBOOT_BOARD_DEFCONFIG setting.  Stop.
```

解决：

未为 uboot 指定开发板，make menuconfig 重新指定即可：

```
bootloader --> (apf27) Board defconfig 
```

报错：

```
linux/linux.mk:558: *** No kernel defconfig name specified, check your BR2_LINUX_KERNEL_DEFCONFIG setting.  Stop.
```

解决：

未指定 kernel 编译目标，make menuconfig 重新指定即可：

```
kernel --> (multi_v5) Defconfig name
```

以上是无用功，应该直接指定开发板，自动生成 .config

buildroot 需顺序编译，make 不指定线程数 -jN

```
make qemu_arm_vexpress_defconfig
make
```

结果在output/images下生成zImage、vexpress-v2p-ca9.dtb、rootfs.ext2三个文件，分别是内核、DeviceTree文件和文件系统。

```
qemu-system-arm -M vexpress-a9 -smp 4 -m 1024M -kernel output/images/zImage -append "root=/dev/mmcblk0 console=ttyAMA0 loglevel=8" -dtb output/images/vexpress-v2p-ca9.dtb -sd output/images/rootfs.ext2 -nographic
```

更多的默认 config 可以在 /configs/ 下找到。
