- 积分
- 35
贡献2
飞刀0 FD
注册时间2010-8-16
在线时间14 小时
|
楼主 |
发表于 2011-3-30 20:31:21
|
显示全部楼层
本帖最后由 liushi123 于 2011-3-30 20:33 编辑
这是我用busybox制作的根文件系统的内容
[root@localhost rootfs]# cd rootfs
[root@localhost rootfs]# ls -l
drwxr-xr-x 2 root root 4096 03-29 19:42 bin
drwxr-xr-x 2 root root 4096 03-29 21:00 dev
drwxr-xr-x 3 root root 4096 03-29 19:58 etc
drwxr-xr-x 2 root root 4096 03-29 20:05 lib
lrwxrwxrwx 1 root root 11 03-29 19:42 linuxrc -> bin/busybox
drwxr-xr-x 2 root root 4096 03-29 19:44 mnt
drwxr-xr-x 2 root root 4096 03-29 19:44 proc
drwxr-xr-x 2 root root 4096 03-29 19:42 sbin
drwxr-xr-x 2 root root 4096 03-29 19:44 sys
drwxr-xr-x 2 root root 4096 03-29 19:44 tmp
drwxr-xr-x 2 root root 4096 03-29 19:44 usr
drwxr-xr-x 2 root root 4096 03-29 19:45 var
[root@localhost rootfs]# cd etc
[root@localhost etc]# ls -l
-rwxr-xr-x 1 root root 104 03-29 19:58 fstab
-rw-r--r-- 1 root root 34 03-29 19:55 fstab~
drwxr-xr-x 2 root root 4096 03-29 20:26 init.d
-rwxrwxrwx 1 root root 101 03-29 19:55 inittab
-rw-r--r-- 1 root root 134 03-29 19:55 profile
[root@localhost etc]# cat fstab
proc /proc proc defaults 0 0
none /dev/pts devpts mode=0622 0 0
tmpfs /dev/shm tmpfs defaults 0 0
[root@localhost etc]# cat inittab
::sysinit:/etc/init.d/rcS
::respawn:-/bin/sh
tty2::askfirst:-/bin/sh
::ctrlaltdel:/bin/umount -a -r
[root@localhost etc]# cd init.d
[root@localhost init.d]# ls -l
-rwxr-xr-x 1 root root 188 03-29 20:26 rcS
-rw-r--r-- 1 root root 190 03-29 20:26 rcS~
[root@localhost init.d]# cat rcS
#!/bin/sh
/bin/mount -t proc proc /proc
/bin/mount -t sysfs sysfs /sys
/sbin/mdev -s
/bin/mount -a
/sbin/ifconfig eth0 192.168.1.15 up
/sbin/ifconfig eth1 192.168.1.16 up
exec /sbin/init
通过mkyaffs2image rootfs yaffs生成的文件下载后,重启最后提示:
Warning: unable to open an initial console.
Failed to execute /linuxrc. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
我把开发板自带的文件系统中/usr/lib/中的内容去掉后,制作成文件系统下载后也提示上述内容,内核用的是开发板自带的2.6.28 |
|