一、Attempted to kill init!
没有其他信息,直接报 kill init。
可能的原因 1:
Linux Kernel 和 Buildroot Rootfs 的 ABI 接口不一致。
Linux Kernel:
-> Kernel Features
-> Use the ARM EABI to compile the kernel
Buildroot Rootfs:
-> Target options
-> Target ABI
Embedded application binary interface (EABI), 嵌入式应用二进制接口。
查看编译器属性:
$ buildroot/output/host/usr/bin/arm-buildroot-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/home/wu/opensource/buildroot/output/host/bin/arm-buildroot-linux-gnueabi-gcc.br_real
COLLECT_LTO_WRAPPER=/home/wu/opensource/buildroot/output/host/libexec/gcc/arm-buildroot-linux-gnueabi/9.2.0/lto-wrapper
Target: arm-buildroot-linux-gnueabi
Configured with:
省略...
解决办法:
重新配置内核支持 EABI
$ make menuconfig
Kernel Features --->
[*] Use the ARM EABI to compile the kernel
根本原因:
Linux 和 Rootfs 的编译器不一致。
二、can't open /r/dev/console: no such file
解决办法:
$ mknod /dev/console c 5 1
$ mknod dev/null c 1 3 mknod
三、bad init /linuxrc: Exec format error
可能的原因 1:
CONFIG_BINFMT_ELF=n
可能的原因 2:
拷贝 rootfs 到目标板时数据损坏。
检查方法:
$ readelf /rootfs/bin/busybox
$ du -sh /rootfs/bin/busybox
避免问题的方法:
$ sync
四、FATAL: kernel too old
可能的原因 1:
交叉编译器在制作时限制了使用的最低内核版本。
确认文件系统要求的最低内核:
$ file buildroot/output/target/lib/libc-2.30.so
buildroot/output/target/lib/libc-2.30.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 4.14.0, stripped
或者
$ cd buildroot/output/build/glibc-2.30-20-xxx
$ grep "enable-kernel" ./* -nR
暂时只遇到这些情况,后面有机会在补充。
成功挂载的效果:
你和我各有一个苹果,如果我们交换苹果的话,我们还是只有一个苹果。但当你和我各有一个想法,我们交换想法的话,我们就都有两个想法了。如果你也对嵌入式系统开发有兴趣,并且想和更多人互相交流学习的话,请关注我的公众号:ESexpert,一起来学习吧,欢迎各种收藏/转发/批评,小小的转发一下对我来说是极大的恩惠,十分感谢!