Chinaunix首页 | 论坛 | 博客
  • 博客访问: 376867
  • 博文数量: 38
  • 博客积分: 3071
  • 博客等级: 中校
  • 技术积分: 423
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-15 11:11
文章分类

全部博文(38)

文章存档

2017年(1)

2011年(1)

2010年(5)

2009年(6)

2008年(3)

2007年(22)

我的朋友

分类: LINUX

2008-01-31 13:26:23

    这里以ixp435平台为例子。
  1. Get source code: busybox-1.7.2-1 (当然其他的版本的都可以)
  2. Tool chain:armv5-linux-* (和编linux kernel的相同)
  3. make menuconfig ,配置功能,可以从其他地方拿一个过来改改。注意打开"Busybox Settings"->"Installation Options"->" Don't use /usr" 这样在安装的时候会安装到自己指定的目录(default ./_install),或者可以在make时加参数CONFIG_PREFIX=目录
  4. make ARCH=arm CROSS_COMPILE=armv5b-linux- install
  5. 复制必要的库文件: 如果没有,会出现这样的错误
    Failed to execute /sbin/init.  Attempting defaults...
    Kernel panic - not syncing: No init found. Try passing init= option to kernel.
    库文件要到这里使用的编译器相对应的目录中找。这里一般需要两类库文件:一类是busybox编译完后提示出来的lib:比如
    Trying libraries: crypt m
    Library crypt is needed
    Library m is needed
    Final link with: crypt m
    这里意思是需要libcrypt和libm的库。还有一类是最基本的libc库和ld库。
  6. 做ramdisk,可以参考我前面的文章。
  7. 到这里,一个最简单的fs已经工作了,已经可以看到这样一个东西了
    RAMDISK: Compressed image found at block 0
    Time: OSTS clocksource has been installed.
    VFS: Mounted root (ext2 filesystem).
    Freeing init memory: 140K
    init started: BusyBox v1.7.2 (2008-01-30 14:38:42 CST)
    starting pid 18, tty '': '/etc/init.d/rcS'
    Cannot run '/etc/init.d/rcS': No such file or directory

    Please press Enter to activate this console.
    starting pid 19, tty '': '/bin/sh'


    BusyBox v1.7.2 (2008-01-30 14:38:42 CST) built-in shell (ash)
    Enter 'help' for a list of built-in commands.

    # ls
    bin dev lib linuxrc lost+found sbin
  8. 复制/etc/文件,直接使用busybox source中带的sample,
    cp examples/bootfloppy/etc/* _install/ -ar
    再创建一个/proc目录, 现在是这个样子
    Freeing init memory: 140K
    init started: BusyBox v1.7.2 (2008-01-30 14:38:42 CST)
    starting pid 18, tty '': '/etc/init.d/rcS'
    starting pid 20, tty '': '/bin/sh'


    BusyBox v1.7.2 (2008-01-30 14:38:42 CST) built-in shell (ash)
    Enter 'help' for a list of built-in commands.


    Processing /etc/profile... Done

    # ls
    bin etc linuxrc proc
    dev lib lost+found sbin
           到这里为止,一个基本的文件系统就可以了。接下来就是往里加入自己需要的东西就可以了。
阅读(11582) | 评论(9) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-10-24 09:23:36

好的,多谢博主!

chinaunix网友2009-10-23 15:01:46

按您说的,是不是直接把libm.*文件复制到用make install命令后生成的文件系统里面,而对于make时出现的这个提示暂时无视? 请博主指点,谢谢! 能否加一下我QQ:857147285,我是学生,现在做嵌入式,正在做文件系统,多谢!

chinaunix网友2009-10-23 10:11:58

麻烦博主,我做文件系统出现了同样的问题, AR util-linux/volume_id/lib.a LINK busybox_unstripped Trying libraries: crypt m Library crypt is not needed, excluding it Library m is needed, can't exclude it (yet) Final link with: m” 按你给楼上的回复,要将libm.*文件copy到/lib目录下,可是busybox下面的目录没有/lib,类似的只有/libbb,还有就是链接时候一直显示链接不正确,一直未搞清楚怎么弄,您能不能给下详细解释,多谢啦!

chinaunix网友2009-06-19 21:08:26

为什么会出现这种问题呢,我按照你的做的也是出现这种情况》

chinaunix网友2009-03-14 09:13:21

很奇怪 我的也是一直提示“ AR util-linux/volume_id/lib.a LINK busybox_unstripped Trying libraries: crypt m Library crypt is not needed, excluding it Library m is needed, can't exclude it (yet) Final link with: m” 一直搞不清到底要把哪里的库 放到哪里去呢?希望楼主看到能回复一下~谢谢