busybox移植

系统:Ubuntu 16.04

busubox:1.29.3(busybox版本差异不大,因此新旧版本无所谓)

下载地址:www.busybox.net

 

1. 修改Makefile

ARCH ?= arm
CROSS_COMPILE ?= /home/linuxwei/toolchain/arm-2009q3/bin/arm-none-linux-gnueabi-

2. make menuconfig配置

Settings  --->
    --- Build Options
    [*] Build static binary (no shared libs) 
Settings  --->
    --- Library Tuning 
    [*]   vi-style line editing commands
    [*]   Fancy shell prompts (NEW) 
Linux Module Utilities  ---> 
    [ ] Simplified modutils
    [*] depmod (26 kb) (NEW)
    [*] insmod (22 kb) (NEW) 
    [*] lsmod (4.3 kb) (NEW)
    [*]   Pretty output (NEW)
    [*] modinfo (25 kb) (NEW)
    [*] modprobe (29 kb) (NEW)
    [*]   Blacklist support (NEW)
    [*] rmmod (3.6 kb) (NEW)
Linux System Utilities  --->
    [*] mdev (16 kb) (NEW)
    [*]   Support /etc/mdev.conf (NEW) 
    [*]     Support subdirs/symlinks (NEW)
    [*]       Support regular expressions substitutions when renaming device (NEW) 
    [*]     Support command execution at device addition/removal (NEW)
    [*]   Support loading of firmware (NEW)

3. make

错误:

util-linux/lib.a(nsenter.o): In function `nsenter_main':
nsenter.c:(.text.nsenter_main+0x180): undefined reference to `setns'
coreutils/lib.a(sync.o): In function `sync_main':
sync.c:(.text.sync_main+0x6c): undefined reference to `syncfs'

解决方案:

第1步:在make menuconfig中去掉nsenter

Linux System Utilities  --->
    [ ] nsenter (8.6 kb) 

第2步:在make menuconfig去掉sync

Coreutils  ---> 
    [ ] sync (769 bytes)

4. make install

在busybox顶层目录下会生成一个_install目录,其中包含了busybox及每个命令的软链接,只要将这个目录拷贝到目标平台上就可以了。

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值