编译busybox
来源:互联网 发布:nodejs json 编辑:程序博客网 时间:2024/06/04 19:46
1、编译busybox
交叉编译器:
# tar jxvf busybox-
修改源码、配置、编译
-----------------------------------------------
# cd busybox-1.4.1
修改 Makefile
ARCH ?= arm
CROSS_COMPILE ?= /usr/local/arm/
# make menuconfig
Busybox Settings --->
Build Options --->
[*] Build BusyBox as a static binary (no shared libs) //这样就省去了寻找共享库的麻烦
Installation Options --->
[*] Don't use /usr
Linux System Utilities --->
[*] mdev //成功移植完
[*] Support /etc/mdev.conf
[*] Support command execution at device addition/removal
Shells --->
Choose your default shell (ash) --->
# make
# make install
这时会在你的编译目录下生成一个_install的目录,里面包含了生成的所有文件和目录结构。
为mdev的运行准备环境
-----------------------------------------------
mdev需要改写/dev和/sys两个目录。所以必须保证这两个目录是可写的(一般会用到sysfs,tmpfs。所以要重新编译内核)。然后在你的启动脚本文件中加入/sbin/mdev –s
linux-
File systems --->
Pseudo filesystems --->
[*] sysfs file system support
[*] Virtual memory file system support (former shm fs)
[*] Tmpfs POSIX Access Control Lists
编译busybox时遇到的问题:
如果是静态编译的话
Busybox Settings --->
Build Options --->
[*] Build BusyBox as a static binary (no shared libs)
# make
将会遇到下面问题:
applets/applets.c:20:2: error: #warning Static linking against glibc produces buggy executables
applets/applets.c:21:2: error: #warning (glibc does not cope well with ld --gc-sections).
applets/applets.c:22:2: error: #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
applets/applets.c:23:2: error: #warning Note that glibc is unsuitable for static linking anyway.
applets/applets.c:24:2: error: #warning If you still want to do it, remove -Wl,--gc-sections
applets/applets.c:25:2: error: #warning from top-level Makefile and remove this warning.
make[1]: *** [applets/applets.o] Error 1
这个警告的定义在applets/applets.c中。将这段警告注释掉就可以了。这段警告的意思是告诉你最好用uclibc编译,而不是用glibc因为glibc比较大,在嵌入式系统中,对空间占用要求较高,所以会有这样的要求。
# vi /busybox-
注释掉20 -- 28行内容即可
# vi applets/applets.c
/*
#if ENABLE_STATIC && defined(__GLIBC__) && !defined(__UCLIBC__)
#warning Static linking against glibc produces buggy executables
#warning (glibc does not cope well with ld --gc-sections).
#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
#warning Note that glibc is unsuitable for static linking anyway.
#warning If you still want to do it, remove -Wl,--gc-sections
#warning from top-level Makefile and remove this warning.
#error Aborting compilation.
#endif
*/
miscutils/taskset.c:17: error: parse error before '*' token
-----------------------------------------------
最根本的解决办法是换一个libc库,可是现在还不知道哪个库最合适,唯有暂时将有问题的命令关掉
Miscellaneous Utilities --->
[ ] taskset
Runit Utilities --->
[ ] runsv
内核启动时遇到的问题:
“could not run '/bin/sh': No such file or directory”
解决方法:
要这样配置:
Shells --->
Choose your default shell (ash) --->
如果是这样配置的话,虽然可以生成ash,但不能生成sh,将会在内核启动时出现上面出现的问题:
Shells --->
Choose your default shell (ash) --->
[*] ash
这样,编译完成之后,在busybox目录下会生成一个_install目录,里面有/bin和/sbin以及一个linuxrc文件!
上一篇:移植linux2.6.19成功^_^
下一篇:建立根文件系统目录
- 以游戏邦为例谈游戏网站的运营...
- 简述HTML的基本工具
- varnish-cache 安装配置及体验...
- 简易通用数据库API c++ wrappe...
- 阿里云 C SDK应用集锦
- linux 常见服务端口
- 什么是shell
- linux socket的bug??
- 【ROOTFS搭建】busybox的httpd...
- linux的线程是否受到了保护?...
- 如何编写一个C程序实现将字符...
- C程序能不能在main函数之前调...
- 看一个程序调用了哪些动态库用...
- 回复不了你啊,咋,威望值不够...
- mysql的medium.cnf在哪里?...
- BusyBox编译
- 编译busybox
- busybox编译
- 编译busybox
- busybox编译
- 编译busybox
- 编译Busybox
- 编译busybox
- 编译&更新busybox
- busybox编译文件系统
- Busybox 1.1.3编译
- 交叉编译busybox
- busybox编译心得
- 编译busybox出错
- BUSYBOX编译备忘录
- andoid编译 整合busybox
- android内核,busybox编译
- busybox交叉编译
- hdu 3466 DP
- U-BOOT FOR S3C2410 NAND-BOOT
- uboot for s3c2410 nandboot 使用saveenv保存环境变量
- 使U-BOOT能正确引导LINUX
- 移植linux2.6.19成功^_^
- 编译busybox
- 建立根文件系统目录
- Wince bootloader和内核定制
- bootloader中USB下载的简单分析
- 关于wince文件夹下文章的声明
- TOC结构体
- wince存储与地址映射技术
- WINCE下string使用注意
- WINCE下消息传递和消息队列