Chinaunix首页 | 论坛 | 博客
  • 博客访问: 278753
  • 博文数量: 91
  • 博客积分: 1772
  • 博客等级: 上尉
  • 技术积分: 930
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-17 19:49
文章分类

全部博文(91)

文章存档

2012年(1)

2011年(36)

2010年(50)

2008年(4)

我的朋友

分类: LINUX

2008-08-10 21:56:20

此文章可以解决2个问题:
1. root fs 不能使用Tab键,或者目录没有显示。
解决方法:在busybox中Busybox Settings --->Busybox Library Tuning  --->
2)  MD5: Trade Bytes for Speed            
*] Faster /proc scanning code (+100 bytes)   
*] Support for /etc/networks                 
*] Support for /etc/networks
*]   Additional editing keys 
*]   vi-style line editing commands 
*]   History saving 
*]   Tab completion 
*]   Username completion 
*]   Fancy shell prompts
 
2. busybox编译不过去。
解决方法:见下文
 
 
 
 
【转】busybox移植
http://blog.ednchina.com/kevin619/135016/message.aspx
修改源码、配置、编译
-----------------------------------------------
# cd busybox-1.7.0
# vi Makefile +176
ARCH            ?= arm
CROSS_COMPILE   ?= /usr/local/arm/3.3.2/bin/arm-linux-
# make menuconfig
Busybox Settings --->
    Build Options --->
        [*] Build BusyBox as a static binary (no shared libs) //(1)
    Installation Options --->
        [*] Don't use /usr               //(2)
Linux System Utilities --->
    [*] mdev                             //(3)
    [*] Support /etc/mdev.conf
    [*] Support command execution at device addition/removal
Shells --->   
    Choose your default shell (msh) ---> //(4)
(1) 这个选项是一定要选择的,这样才能把busybox编译成静态链接的可执行文件,运行时才独立于其他函
数库.否则必需要其他库文件才能运行,在单一个linux内核不能使他正常工作。
(2) 这个选项也一定要选,否则make install后,busybox将安装在原系统的/usr下,这将覆盖掉系统原有的
命令.选择这个选项后,make install后会在busybox目录下生成一个叫_install的目录,里面有busybox和
指向他的链接.
(3) 成功移植完2.6.19后,由于没有启动udev,造成/dev下没有设备文件。也就是说所有的设备都没有挂
接进来。最新的busybox已经包含了udev的简化版本即mdev,且使用非常简单。 要使用mdev还需要在root
filesystem中做适当配置。
(4) 由于ash功能不够强大,不能支持tab补齐,历史纪录等等的高级功能,所以使用busybox里面的msh代替
ash.
    因为busybox主要应用于对空间要求非常严格的嵌入式系统,所以它推荐使用uclibc而不鼓励使用
glibc,如果你没有安装uclibc,而且在 build Options也选择了Build BusyBox as a static binary(no shared libs),那肯定无法编译通过的,当然如果你之前build Options选择的是动态编译的话就不会有
这样的问题出现了。假设你是第一种情况,我们可以这样解决:把applets/applets.c开头的几行
warning注释掉
# 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
*/
# make
# make install
这时会在你的编译目录下生成一个_install的目录,里面包含了生成的所有文件和目录结构。

为mdev的运行准备环境
-----------------------------------------------
    mdev需要改写/dev和/sys两个目录。所以必须保证这两个目录是可写的(一般会用到sysfs,tmpfs。所
以要重新编译内核)。然后在你的启动脚本文件中加入/sbin/mdev -s
linux-2.6.19 -- make menuconfig
File systems --->
    Pseudo filesystems --->
        [*] sysfs file system support  
        [*] Virtual memory file system support (former shm fs)
        [*]   Tmpfs POSIX Access Control Lists
 
 
编译时遇到的问题(1):
-----------------------------------------------
如果busybox编译成static linking
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比较大,busybox在寸土寸金的嵌入式系统中运用比较多,所以会
有这样的要求。
# vi /busybox-1.7.0/applets/applets.c +20
注释掉20 -- 28行内容即可

miscutils/taskset.c:17: error: parse error before '*' token
-----------------------------------------------
最根本的解决办法是换一个libc库,可是现在还不知道哪个库最合适,唯有暂时将有问题的命令关掉
Miscellaneous Utilities --->
    [ ] taskset
[ ]各式各样的
runit/runsv.c: In function `gettimeofday_ns':
-----------------------------------------------
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 (none) --->
[*] ash
阅读(2499) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~