1 ref: http://tech.ddvip.com/2007-04/117758451623217.html
2 Linux下用Busy Box制作Ramdisk全过程
3 3G双线全能空间1元 开网店-找友创互联 0元招收代理【CN域名0.5元】
5 http://tech.ddvip.com 2007年04月26日 社区交流
6 关键字: Linux on Power GDB UNIX 进程 共享上网设置 Linux无法引导 NTP服务
7 本文详细介绍Linux下用Busy Box制作Ramdisk全过程
15 #mkdir bin dev etc lib proc sbin tmp usr var
19 #mkdir usr/bin usr/lib usr/sbin
21 #mkdir var/lib var/lock var/log var/run var/tmp
27 #cd ${OBJ_LIB}/lib (${OBJ_LIB}是交叉编译环境的目录)
29 #for file in libc libcrypt libdl libm
31 >libpthread libresolv libutil
35 >cp $file-*.so /home/fortis/rootfs/lib
37 >cp -d $file.so.[*0-9] /home/fortis/rootfs/lib
41 #cp -d ld*.so* /home/fortis/rootfs/lib
45 3.1 下载busybox(http://www.busybox.net/)并解压。
47 3.2 进入解压后的目录,配置Busybox
53 General Configuration >
59 [*] Build BusyBox as a static binary (no shared libs)
61 /* 将busybox编译为静态连接,少了启动时找动态库的麻烦 */
63 [*] Do you want to build BusyBox with a Cross Compiler?
65 (/usr/local/arm/3.3.2/bin/armlinux)
67 Cross Compiler prefix/* 指定交叉编译工具路径 */
73 [*] Support reading an inittab file
75 /* 支持init读取/etc/inittab配置文件,一定要选上 */
79 Choose your default shell (ash) >
81 /* (X) ash 选中ash,这样生成的时候才会生成bin/sh文件
83 * 看看我们前头的linuxrc脚本的头一句:
85 * #!/bin/sh 是由bin/sh来解释执行的
101 [*] echo (basic SuSv3 version taking no options)
117 Linux System Utilities >
123 [*] Support loopback mounts
125 [*] Support for the old /etc/mtab file
127 Networking Utilities >
139 $make TARGET_ARCH=arm CROSS=armlinux
141 PREFIX=/home/arm/dev_home/rootfs/my_rootfs/ all install
143 PREFIX指明安装路径:就是我们根文件系统所在路径。
147 可以直接拷贝宿主机上的,或者自建几个就是。
151 #mknod -m 600 console c 5 1
161 echo "Hello linux ,gggggg"
165 然后修改权限:chmod 775 linuxrc
171 #dd if=/dev/zero of=initrd.img bs=1k count=8192
173 #/sbin/mke2fs -F -v -m0 initrd.img
175 #mount -o loop initrd.img initrd
177 #cp -av rootfs/* initrd
184 # use busybox generate rootfs
185 http://blog.chinaunix.net/u1/55623/showart_436042.html
187 # use skyeye run armlinux
188 http://blog.chinaunix.net/u2/78225/showart_1226094.html
191 http://www.diybl.com/course/6_system/linux/Linuxjs/200866/123072.html
193 # write initrd into vmlinuz
194 http://www.91linux.com/html/article/qianrushiyingyong/20081110/13740.html
196 # understand initrd more
197 http://blog.linux.org.tw/~jserv/archives/001954.html