这里以ixp435平台为例子。 <br />Get source code: busybox-1.7.2-1 (当然其他的版本的都可以)<br />Tool chain:armv5-linux-* (和编linux kernel的相同)<br />make menuconfig ,配置功能,可以从其他地方拿一个过来改改。注意打开'Busybox Settings'->'Installation Options'->' Don't use /usr' 这样在安装的时候会安装到自己指定的目录(default ./_install),或者可以在make时加参数CONFIG_PREFIX=目录<br />make ARCH=arm CROSS_COMPILE=armv5b-linux- install<br />复制必要的库文件: 如果没有,会出现这样的错误<br />Failed to execute /sbin/init. Attempting defaults...<br />Kernel panic - not syncing: No init found. Try passing init= option to kernel.<br />库文件要到这里使用的编译器相对应的目录中找。这里一般需要两类库文件:一类是busybox编译完后提示出来的lib:比如Trying libraries: crypt m<br />Library crypt is needed<br />Library m is needed<br />Final link with: crypt m<br />这里意思是需要libcrypt和libm的库。还有一类是最基本的libc库和ld库。<br />做ramdisk,可以参考我前面的**。<br />到这里,一个最简单的fs已经工作了,已经可以看到这样一个东西了<br />RAMDISK: Compressed image found at block 0<br />Time: OSTS clocksource has been installed.<br />VFS: Mounted root (ext2 filesystem).<br />Freeing init memory: 140K<br />init started: BusyBox v1.7.2 (2008-01-30 14:38:42 CST)<br />starting pid 18, tty '': '/etc/init.d/rcS'<br />Cannot run '/etc/init.d/rcS': No such file or directory<br /><br />Please press Enter to activate this console. <br />starting pid 19, tty '': '/bin/sh'<br /><br /><br />BusyBox v1.7.2 (2008-01-30 14:38:42 CST) built-in shell (ash)<br />Enter 'help' for a list of built-in commands.<br /><br /># ls<br />bin dev lib linuxrc lost+found sbin<br /><br />复制/etc/文件,直接使用busybox source中带的sample, <br />cp examples/bootfloppy/etc/* _install/ -ar<br />再创建一个/proc目录, 现在是这个样子 <br />Freeing init memory: 140K<br />init started: BusyBox v1.7.2 (2008-01-30 14:38:42 CST)<br />starting pid 18, tty '': '/etc/init.d/rcS'<br />starting pid 20, tty '': '/bin/sh'<br /><br /><br />BusyBox v1.7.2 (2008-01-30 14:38:42 CST) built-in shell (ash)<br />Enter 'help' for a list of built-in commands.<br /><br /><br />Processing /etc/profile... Done<br /><br /># ls<br />bin etc linuxrc proc<br />dev lib lost+found sbin<br /> 到这里为止,一个基本的文件系统就可以了。接下来就是往里加入自己需要的东西就可以了。<br /><br /> |
|