WDS1期第11课 根文件系统 3 busybox 编译安装根文件系统make menuconfig install

配置 编译 busybox,在根目录下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
  1. 解压 tar xjf busybox-1.7.0.tar.bz2
  2. make menuconfig
    选择补全命令
    Busybox Settings  --->
    	Busybox Library Tuning  --->
    		[*] Tab completion 
    
    修改交叉编译工具:新版busybox可以在交互界面直接选择,1.7.0版本只能在顶层Makefile中修改,CROSS_COMPILE ?= arm-linux-
    可能出错:Makefile:405: *** mixed implicit and normal rules: deprecated syntax
    Makefile:1242: *** mixed implicit and normal rules: deprecated syntax
    原因:新版Makefile不支持这样的组合目标:config %config(一个有通配符,另一个没有通配符)
    办法 :要么把config %config拆成2个规则,要么把其中一个目标去掉。
    具体措施
    a.顶层Makefile 405行 改为: %config:scripts_basic outputmakefile FORCE
    b.顶层Makefile 1242行 改为: %/:prepare scripts FORCE
  3. make
    可能出错1:/include/linux/netfilter.h:57:17: error: field ‘in’ has incomplete type
    make[1]: *** [ipsvd/tcpudp.o] Error 1
    Makefile:701: recipe for target ‘ipsvd’ failed
    根据提示的路径找到netfilter.h,添加头文件#include <netinet/in.h>
    在这里插入图片描述
    可能出错2:recipe for target ‘loginutils/passwd.o’ failed
    make[1]: *** [loginutils/passwd.o] Error 1
    Makefile:701: recipe for target ‘loginutils’ failed
    办法:BusyBox源码的include目录下/libbb.h 文件添加头文件 #include <sys/resource.h>
    在这里插入图片描述
    最终出现以下说明编译成功:
    在这里插入图片描述
  4. install
    不能make install,这将安装到PC系统可能导致系统出错,
    创建一个目录,mkdir -p fs_root
    然后安装到该目录下,make CONFIG_PREFIX=/fs_root install
    出现如下应该安装成功:
    在这里插入图片描述
    ls -l:可以看到所有工具都指向了busybox,
    在这里插入图片描述
    在这里插入图片描述
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值