分页:
上一页 1 2 3 4 5 [6] 7 8 下一页
这在各种环境中都有用,但是为了便于说明,我们将仅使用我们的迷你环境重新扫描SCSI总线,等待外置磁盘被识别,然后切换为使用该磁盘作为真实的根继续引导。
为了使用这种方法,我们需要创建两项,内核和initrd映像。
内核就是具有内置initrd支持的普通内核。initrd映像是包含我们的迷你根文件系统的回送文件系统映像(此映像可以使用gzip进行压缩以减少其大小)。
有关创建或定制自己的initrd映像的详细信息,可以查看参考资料部分。
在initrd映像中,有一个名为linuxrc的文件。当加载initrd时会执行此文件,所以确保其具有执行权限!我们为了进行说明,所以 linuxrc非常简单:
清单 1. initrd linuxrc
#!/bin/sh
REAL_ROOT=/dev/sda1
# mount the /proc filesystem
mount -t proc none /proc
#for scsi-emulation
# modprobe sd_mod
#for pcmcia
# modprobe pcmcia_core
#for FireWire
# modprobe ieee1394
# modprobe ohci1394
# modprobe raw1394
# modprobe sbp2
#for USB
# modprobe usbcore
# modprobe ohci-hcd
# modprobe uhci-hcd
# modprobe usb-storage
# loop rescanning the scsi bus + rerunning devfsd
retries=5
i=1
until [ -e $REAL_ROOT ]
do
if [ $i -gt $retries ]
then
echo "Unable to mount real root ($REAL_ROOT) - Giving up!"
/bin/ash
exit
fi
echo "Real root ($REAL_ROOT) not found, retrying ($i)"
sleep 1
分页:
上一页 1 2 3 4 5 [6] 7 8 下一页