|
请帮我看看问题出在哪:
我要做一张软盘linux,过程如下:
建目录/floppy-linux:
#mkdir floppy-linux
#cd floppy-linux
建立一些标准的目录
#mkdir dev etc etc/rc.d bin proc mnt tmp var
#chmod 755 dev etc etc/rc.d bin mnt tmp var
#chmod 555 proc
#ln -s sbin bin
建立一般终端机设备
#cd dev
#mknod tty c 5 0
#mkdir console c 5 1
#chmod 666 tty console
建立 VGA Display 虚拟终端机设备
#mknod tty0 c 4 0
#chmod 666 tty0
再建立 RAM disk 设备
#mknod ram0 b 1 0
#chmod 600 ram
再建立 floppy 设备:
#mknod fd0 b 2 0
#chmod 600 fd0
最后在建立 null 设备:
#mknod null c 1 3
#chmod 666 null
修改 Makefile 中的 DOSTATIC 参数,从 false 改为 true
修改了 BusyBox 中的 init.c
#ifndef INIT_SCRIPT
#define INIT_SRCIPT “ /etc/rc.d/rc.sysinit ”
#endif
编辑 inittab ,内容如下:
::sysinit:/etc/rc.d/rc.sysinit
::askfirst:/bin/sh
#chmod 644 inittab
编辑 /floppy-linux/etc/rc.d 底下的 rc.sysinit
#!/bin/sh
mount -a
#chmod 755 rc.sysinit
编辑 /floppy-linux/etc/ 底下的 fstab
proc /proc proc defaults 0 0
#chmod 644 fstab
然后
#cd /floppy-linux/bin
#cp /busybox-0.51/busybox ./init
#ln -s init ls
#ln -s init cp
#ln -s init mount
#ln -s init umount
#ln -s init more
#ln -s init ps
#ln -s init sh
制作 ram disk
dd if=/dev/zero of=/tmp/tmp_loop bs=1k count=2048
#losetup /dev/loop0 /tmp/tmp_loop
#mke2fs -m 0 /dev/loop0
#mount -t ext2 /dev/loop0 /mnt
#cp -a /floppy-linux /mnt
#umount /mnt
#losetup -d /dev/loop0
#dd if=/tmp/tmp_loop | gzip -9 > /tmp/Image.gz
#rm -f /tmp/tmp_loop
#sync
编辑syslinux.cfg
TIMEOUT 20
DEFAULT linux
LABEL linux
KERNEL linux
APPEND root=/dev/ram0 initrd=Image.gz
最后一起拷贝到磁盘, 重新启动系统后,加载文件系统后出现:
kernel panic :no init found ,try passing init = option to kernel
我在/bin目录下可是已经有了由busybox而来的init了(#cp /busybox-0.51/busybox ./init )
难道它不能引导吗? 一直没解决.
请哪位能指点一下,非常感谢! |
|