#!/bin/nash
mount -t proc /proc /proc
setquiet
echo Mounted /proc filesystem
echo Mounting sysfs
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mknod /dev/console c 5 1
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mkdir /dev/pts
mkdir /dev/shm
echo Creating device nodes
#The after line were added by hail
/sbin/udevstart
#The before line were added by hail
echo -n /sbin/hotplug> /proc/sys/kernel/hotplug
#the after lines were added by hail
echo ***Loading scsi************************************************************
insmod /lib/scsi_transport_spi.ko
insmod /lib/scsi_transport_fc.ko
echo ****Loading usb-storage **************************************************
insmod /lib/usb-storage.ko
echo ****Loadin usb-uhci(ehci-hcd.ko)******************************************
insmod /lib/ehci-hcd.ko
echo wait 15 seconds for init UsbDisk*******************************************
/bin/sleep 15
/sbin/udevstart
#the before lines were added by hail
#makedevs
#makedevs
echo Creating root device
mkrootdev /dev/root
#The after lines were added by hail
echo ****Reread partition table *************************************************
/sbin/sfdisk -R /dev/sda
/sbin/sfdisk -R /dev/sdb
这一步会出错: failed to execute sfdisk: 但是我确实把sfdisk拷贝到/sbin并且给了它777的权限。
#The before lines were added by hail
echo Mounting root filesystem
mount -o defaults --ro -t ext3 /dev/root /sysroot
因为前一步失败了。这一步当然不会mount上root
echo Switching to new root
switchroot --movedev /sysroot