欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > windows >内容正文

windows

构建根文件系统之busybox(二)编译

发布时间:2025/4/5 windows 26 豆豆
生活随笔 收集整理的这篇文章主要介绍了 构建根文件系统之busybox(二)编译 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

目录

busybox(二)编译


busybox(二)编译

  • 1.解压,源码包在busybox-1.7.0.tar.bz2,
tar xjf busybox-1.7.0.tar.bz2 cd busybox-1.7.0/
  • 2.查看说明文档INSTALL,注意不能直接使用make install,这样会安装到pc上,破坏pc.应该要使用make CONFIG_PREFIX=xxx目录 install
make menuconfig # This creates a file called ".config"make # This creates the "busybox" executable make install # or make CONFIG_PREFIX=/path/from/root install
  • 3.设置下交叉编译工具为arm-linux-,修改顶层Makefile
CROSS_COMPILE ?=arm-linux-
  • 4.使用make menuconfig配置,发现提示错误,这是因为版本问题,修改下makefile
book@100ask:/work/busybox-1.7.0$ make menuconfig Makefile:405: *** mixed implicit and normal rules: deprecated syntax Makefile:1242: *** mixed implicit and normal rules: deprecated syntax make: *** No rule to make target 'menuconfig'. Stop.

修改以下内容

顶层Makefile 405行:config %config: scripts_basic outputmakefile FORCE 改为: %config: scripts_basic outputmakefile FORCE修改busybox-1.7.0 顶层Makefile 1242行: / %/: prepare scripts FORCE 改为: %/: prepare scripts FORCE如果还不行 要安装 sudo apt-get install libncurses5-dev libncursesw5-dev 这两个库才可以
  • 5.修改配置项目,增加tab补全功能,busybox settings ---busybox libry tuning ----tab completion,输入y选择.其余模块的使能一般在Linux Module Utilities --->中
  • 6.make
  • 7.设置安装路径make CONFIG_PREFIX=~/stu/first_fs install
  • 8.可以看到文件链接到busybox,也就是说bin下面有个busybox的程序,其他ls等都链接到它
book@100ask:~/stu/first_fs$ ls -l 总用量 12 drwxrwxr-x 2 book book 4096 11月 13 23:37 bin lrwxrwxrwx 1 book book 11 11月 13 23:37 linuxrc -> bin/busybox drwxrwxr-x 2 book book 4096 11月 13 23:37 sbin drwxrwxr-x 4 book book 4096 11月 13 23:37 usrbook@100ask:~/stu/first_fs$ ls bin/ls -l lrwxrwxrwx 1 book book 7 11月 13 23:37 bin/ls -> busybox

转载:https://www.cnblogs.com/zongzi10010/p/10023711.html 

总结

以上是生活随笔为你收集整理的构建根文件系统之busybox(二)编译的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。