- 论坛徽章:
- 0
|
这里以ixp435平台为例子。Get source code: busybox-1.7.2-1 (当然其他的版本的都可以)Tool chain:armv5-linux-* (和编linux kernel的相同)make menuconfig ,配置功能,可以从其他地方拿一个过来改改。注意打开"Busybox
Settings"->"Installation Options"->" Don't use /usr"
这样在安装的时候会安装到自己指定的目录(default ./_install),或者可以在make时加参数CONFIG_PREFIX=目录make ARCH=arm CROSS_COMPILE=armv5b-linux- install
复制必要的库文件: 如果没有,会出现这样的错误
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 mLibrary crypt is neededLibrary m is neededFinal link with: crypt m
这里意思是需要libcrypt和libm的库。还有一类是最基本的libc库和ld库。
做ramdisk,可以参考我前面的文章。
到这里,一个最简单的fs已经工作了,已经可以看到这样一个东西了
RAMDISK: Compressed image found at block 0Time: OSTS clocksource has been installed.VFS: Mounted root (ext2 filesystem).Freeing init memory: 140Kinit 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 directoryPlease 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.# lsbin dev lib linuxrc lost+found sbin
复制/etc/文件,直接使用busybox source中带的sample,
cp examples/bootfloppy/etc/* _install/ -ar
再创建一个/proc目录, 现在是这个样子
Freeing init memory: 140Kinit 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# lsbin etc linuxrc procdev lib lost+found sbin
到这里为止,一个基本的文件系统就可以了。接下来就是往里加入自己需要的东西就可以了。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/31934/showart_474189.html |
|