5.修改拷贝过来的profile文件
[root@localhost etc]# vi profile
# /etc/profile: system-wide .profile file for the Bourne shells
                                                                                   
echo "Processing /etc/profile... "
# no-op
                                                                                    
#Set search library patch
echo "Set search library path"
export LD_LIBRARY_PATH = /lib:/usr/lib
                                                                                   
#Set user path
echo "Set user path"
PATH = /bin:/sbin:/usr/bin:/usr/sbin
export PATH
                                                                                   
#Set PSI
echo "Set PS1"
HOSTNAME = /bin/hostname
                                                                                    
export PS1 = "\\e[32m[$USER@HOSTNAME \\w\\a]\\$ \\e[00;37m"
                                                                                   
echo "All Done"
echo
6.修改初始化文件inittabfstab
[root@localhost etc]# vi inittab
::sysinit:/etc/init.d/rcS
::respawn:-/bin/sh
::restart:/sbin/init
                                                                                   
tty2::askfirst:-/bin/sh
::ctrlaltdel:/bin/umount -a -r
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff –a
[root@localhost etc]# vi fstab
proc            /proc   proc    defaults    0   0
none            /tmp    ramfs   defaults    0   0
mdev            /dev    ramfs   defaults    0   0
sysfs           /sys    sysfs   defaults    0   0
7.修改初始化的脚本文件init.d/rcS
[root@localhost etc]# vi init.d/rcS
#! /bin/sh
echo "Processing etc/init.d/rc.S"
                                                                                   
#hostname ${HOSTNAME}
hostname up tech
echo "Mount all"
/bin/mount -a
                                                                                   
echo "Start mdev...."
/bin/echo /sbin/mdev > proc/sys/kernel/hotplug
mdev -s
                                                                                   
                                                                                    
echo "****************************************************"
echo "   rootfs    by    NFS,   s3c2410                "
echo " Created by chenboqiang_uptech @ 2010.11.19              "
echo "                         Good   Luck                             "
echo "            blog:http://chenboqiang.blog.51cto.com               "
echo "                  chen_boiqang@163.com                           "
 
8.创建一个空的mdev.conf文件,在挂载根文件系统时会用到的
[root@localhost etc]# touch mdev.conf
9.从本机拷贝passwdshadowgroup文件
[root@localhost etc]# cp /etc/passwd .
[root@localhost etc]# cp /etc/shadow .
[root@localhost etc]# cp /etc/group .
修改passwd文件,把第一行和最后一行的bash修改成ash
10.busybox默认安装目录中的文件全部复制到这里的rootfs中。会发现多了linuxrc->/bin/busybox文件,这是挂载文件系统需要执行的。
[root@localhost etc]# cd ..
[root@localhost rootfs]# cp -rfv /root/2410-s/busybox-1.12.2/_install/* ./
OK,以上用busybox创建了一个基本的文件系统。
PS:
如果编译busybox时选择动态库方式编译,则需要查看生成的busybox使用哪些动态库,然后它们拷贝到rootfs/lib目录下。
[root@localhost etc]#arm-linux-readelf –d ../bin/busybox
 
可以看出,使用了libm.so.6libc.so.6两个库。发现只拷贝这两个库还不够,还需要ld-linux.so.2libgcc_s.so.1,也就是我编译出来的这个busybox需要4个动态库文件。
这样,使用动态库可以节省一半左右的空间,不过效率有所降低。
11.制作cramfs的文件系统
[root@localhost rootfs]# cd ..
[root@localhost root_stand]# mkcramfs rootfs/ root.cramfs
一.    测试
注意:前提是已烧写好uboot和内核镜像