著作权属陈建业
在这□我们先了解整个启动的流程,首先系统核心由lilo
或loadlin程式读入记忆体,在解压缩後分别载入各周边的驱动程
式。必须注意的是,有些驱动程式采自动侦测(auto-probe)的方
式,判断硬体的设定情形,如果在核心载入的过程中,发现有侦测
错误的情况,必须把确实的硬体设定参数由lilo、loadlin在载入
时传入核心。
在核心完成载入後,会执行init程式,init程式会根据
/etc/inittab的设定完成系统启动的程序。由於在启动系统时,我
们可能希望进入正常的运作模式提供对外服务,或进入系统维护模
式暂时停止对外服务,所以除了特殊事件处理外,每一个项目都指
定run level,通知init这次启动本项目是否要执行。接著init监督
所有由它启动的程式及停电等系统事件,直到shutdown为止。例如
getty负责使用者签入,而一般getty的action为respawn,表示使用
者离线後,init会再重新启动getty等待下一个使用者。
#
# inittab This file describes how the INIT process should set up
# the system in a certain run-level.
#
# Version: @(#)inittab 2.04 17/05/93 MvS
#
# Author: Miquel van Smoorenburg,
#
# 格式: 档案系统的完整性
#
READWRITE=no
if echo -n >> "Testing filesystem status"; then
rm -f "Testing filesystem status"
READWRITE=yes
fi
#
# Check the integrity of all filesystems
#
if [ ! $READWRITE = yes ]; then
/sbin/fsck -A -a
# If there was a failure, drop into single-user mode.
if [ $? -gt 1 ] ; then
echo
echo
echo "**************************************"
echo "fsck returned error code - REBOOT NOW!"
echo "**************************************"
echo
echo
/bin/login
fi
#
# Remount the root filesystem in read-write mode
#
echo "Remounting root device with read-write enabled."
/sbin/mount -w -n -o remount /
if [ $? -gt 0 ] ; then
echo
echo "Attempt to remount root device as read-write failed! This is going to"
echo "cause serious problems... "
echo
echo "If you're using the UMSDOS filesystem, you **MUST** mount the root
partition"
echo "read-write! You can make sure the root filesystem is getting mounted
"
echo "read-write with the 'rw' flag to Loadlin:"
echo
echo "loadlin vmlinuz root=/dev/hda1 rw (replace /dev/hda1 with your root
device)"
echo
echo "Normal bootdisks can be made to mount a system read-write with the
rdev command:"
echo
echo "rdev -R /dev/fd0 0"
echo
echo "You can also get into your system by using a bootkernel disk with a
command"
echo "like this on the LILO prompt line: (change the root partition name
as needed)"
echo
echo "LILO: mount root=/dev/hda1 rw"
echo
echo "Please press ENTER to continue, then reboot and use one of the above
methods to"
echo -n "get into your machine and start looking for the problem. "
read junk;
fi
else
echo "Testing filesystem status: read-write filesystem"
if [ -d /DOS/linux/etc -a -d /DOS/linux/dev ]; then # no warn for UMSDOS
cat << EOF
*** ERROR: Root partition has already been mounted read-write. Cannot check!
For filesystem checking to work properly, your system must initially mount
the root partition as read only. Please modify your kernel with 'rdev' so that
it does this. If you're booting with LILO, add a line:
read-only
to
【责编:admin】
--------------------next---------------------
阅读(284) | 评论(0) | 转发(0) |