使用build root 构建uboot kenrel 和rootfs for vexpress ca9


解压build root

cd 进入解压后的目录

image

make menuconfig

image

target option 选择目标CPU

image

tool chain

使用build root tool chain 不使用external tool chain .

custom tool chain vendor name, 工具链的客制化名称,随便,buildroot-arm

编译完成后,结果在

output 目录里面

image

  • output/

make后的所有文件都安装在此处,如下:

anzyelay@ubuntu:buildroot-2016.05$ ls output/ build host images staging target

    • 1
    • 2
    • build:所有源码包解压出来的文件存放地和编译的发生地
    • host:是由各类源码编译后在你主机上运行的工具(build for host)的安装目录,如arm-linux-gcc就是安装在这里.

1 编译出来的主机工具在host/usr下,

2 根目录所需要的库及一些基本目录就在host/< tuple >/sysroot/或host/usr/< tuple >/sysroot/里 (< tuple >:arm-buildroot-linux-gnueabi),如果是外部toolchain,比如lirano的就在libc里,名字不一样而矣,

    • staging:软链接到host/< tuple >/sysroot/ 就是上面说到的文件系统需要的库等目录,方便查看
    • images:生成的文件系统,内核在此处,
    • target:根文件系统的存放地,但这不能用来nfs mount到开发板,因为buildroot不是root权权运行的,所以现dev/,etc/等一些文件无法创建,所以目录还不完整,要用images/里的rootfs.tar解压出来的根文件目录才能mount.使用如下命令

sudo tar -C /destination/of/extraction -xf images/rootfs.tar

  • dl/

所有默认的下载包都在这里,当这里缺少需要的包时就会自动下载,当然本身下载通常都是很慢的,你可以手动找到相关包下载后放到这里就OK了,make时会自动检测这个目录.

make list-defconfigs

列出具有默认配置的平台

image

image

编译了两个qemu-arm-vexpress_defconfig / qemu_aarch64_virt_defconfig

make help 列出帮助

image

image

image

对于 aarch64 -M virt ,使用下面的命令

qemu-system-aarch64 -M virt -cpu cortex-a57 -nographic -smp 1 -kernel output/images/Image -append "root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0

apt install qemu 安装的qemu-system-aarch64 运行没反应。自己编译一个qemu

image

image

image

换了之后,也无法启动。是build root 的tool chain 有问题吧,换linaro 的tool chain 试一试。

qemu 里面make install , 然后使用 linaro 编译出来的Image 可以成功

posted @ 2022-02-12 13:32  张志伟122  阅读(192)  评论(0编辑  收藏  举报