busybox-1.35.0编译及安装过程,与找不到byteswap.h头文件的问题解决方法


可以从官网下载

busybox-1.35.0

增加变量路径

#source /opt/fsl-imx-wayland/5.4-zeus/environment-setup-aarch64-poky-linux

直接make 发现错误如下:

root@huang-VirtualBox:/home/busybox-1.35.0# make
CC applets/applets.o
In file included from /opt/fsl-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/include-fixed/syslimits.h:7,
from /opt/fsl-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/include-fixed/limits.h:34,
from include/platform.h:157,
from include/libbb.h:13,
from include/busybox.h:8,
from applets/applets.c:9:
/opt/fsl-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/include-fixed/limits.h:194:61: error: no include path in which to search for limits.h
194 | #include_next <limits.h> /* recurse down to the real one */
| ^
In file included from include/libbb.h:13,
from include/busybox.h:8,
from applets/applets.c:9:
include/platform.h:168:11: fatal error: byteswap.h: No such file or directory
168 | # include <byteswap.h>
| ^~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:197: recipe for target 'applets/applets.o' failed
make[1]: *** [applets/applets.o] Error 1
Makefile:372: recipe for target 'applets_dir' failed
make: *** [applets_dir] Error 2

 

解决办法:

make menuconfig进入菜单

->>Settings  --->Cross Compiler prefix(回车),填入aarch64-poky-linux-

->>Settings  --->Path to sysroot(回车),填入/opt/fsl-imx-wayland/5.4-zeus/sysroots/aarch64-poky-linux

 

 再执行:

#make&&make install后,会生成_install文件夹,其中包含link到busybox的所有工具,替换到rootfs中即可

# cd /install

# tar -cjvf busybox.tar.bz2 *

将打包后的 busybox.tar.bz2 压缩包通过U盘、FTP或者NFS等方式拷贝到目标板,并分别解压到/bin和/sbin目录。

将压缩包的bin目录解压到根目录/

# cd busybox.tar.bz2 ~/ # cd # tar -jxvf busybox.tar.bz2 bin -C / 

将压缩包的sbin目录解压到根目录/

# tar -jxvf busybox.tar.bz2 sbin -C / 

 验证:

#busybox 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM