构建根文件系统之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 usr


book@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 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值