现在的位置: 首页 > 综合 > 正文

编译&更新busybox

2013年09月13日 ⁄ 综合 ⁄ 共 1003字 ⁄ 字号 评论关闭
测试速度时候需要使用time命令,现在使用的busybox没有提供,自己重新编译新的busybox。

1. 从www.busybox.net下载最新版本1.7.2;
2. 解压缩,进入目录;
3. 执行"make menuconfig"发现默认大多数cmd都选中了,就按照默认的来编译吧,除了
miscutil->taskset
    导致错误miscutils/taskset.c:17: error: parse error before '*' token
linuxmod->kernel-2.4 support
    导致错误In function `insmod_main': undefined reference to `query_module'
应该是arm-linux-gcc的glibc版本和busybox版本的匹配出了问题;
4. 修改Makefile内容,令CROSS_COMPILE ?=arm-linux- ARCH ?= arm;
这里必须在Makefile中指定ARCH=arm,如果只是在编译的时候指定"make CROSS_COMPILE=arm-linux- ARCH=arm",那么make install的时候会重新编译,得到的busybox是i386架构的,从而导致cp生成的cmd到rootfs处时,系统启动时候会提示:
    “request_module: runaway loop modprobe binfmt-464c”
5. 执行make得到busybox,执行make install在"busybox_$(VERSION)/_install"下得到bin, sbin, usr/bin, usr/sbin等。
6. 拷贝_install/下的所有内容到/data/rootfs2.6下替换原来的东西。
7. 在/data/rootfs2.6下执行
    mknod dev/null c 1 3
    chmod 666 dev/null
否则启动时候提示:
    init: can't open '/dev/null': No such file or directory
不知道why新编译出来的需要访问/dev/null设备。

参考文档:
 http://weibing.blogbus.com/logs/4453804.html
 http://www.hhcn.com/cgi-bin/topic.cgi?forum=3&topic=380&start=0&show=50

抱歉!评论已关闭.