Группа :: Система/Основа
Пакет: startup
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: startup-rc.sysinit.patch
--- rc.d/rc.sysinit.orig 2004-03-06 01:25:28 +1200
+++ rc.d/rc.sysinit 2005-07-18 00:57:19 +1300
@@ -78,6 +78,75 @@
action "Mounting sys filesystem" mount -n -t sysfs sysfs /sys
fi
+# Activate EVMS
+EVMS_ACTIVE=
+STARTEVMS=/sbin/startevms
+if [ -x "$STARTEVMS" ] && ! fgrep -iwqs noevms /proc/cmdline; then
+ action "Starting up EVMS:" "$STARTEVMS" init
+ EVMS_ACTIVE=1
+fi
+
+# Add raid devices
+if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat -a -s /etc/raidtab ] && ! fgrep -iwqs noraidtab /proc/cmdline; then
+ echo -n "Starting up RAID devices: "
+
+ rc=0
+
+ for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do
+ RAIDDEV="${i##*/}"
+ RAIDSTAT=`grep -s "^$RAIDDEV : active" /proc/mdstat`
+ if [ -z "$RAIDSTAT" ]; then
+ # Try raidstart first...if that fails then
+ # fall back to raidadd, raidrun. If that
+ # also fails, then we drop to a shell
+ RESULT=1
+ ExecIfExecutable /sbin/raidstart "$i"
+ RESULT=$?
+ if [ $RESULT -gt 0 ]; then
+ ExecIfExecutable /sbin/raid0run "$i"
+ RESULT=$?
+ fi
+ if [ $RESULT -gt 0 ]; then
+ ExecIfExecutable /sbin/raidadd "$i"
+ ExecIfExecutable /sbin/raidrun "$i"
+ RESULT=$?
+ fi
+ if [ $RESULT -gt 0 ]; then
+ rc=1
+ fi
+ fi
+ echo -n "$RAIDDEV "
+ done
+ echo
+
+ # A non-zero return means there were problems.
+ if [ $rc -gt 0 ]; then
+ echo
+ echo
+ echo "*** An error occurred during the RAID startup"
+ echo "*** Dropping you to a shell; the system will reboot"
+ echo "*** when you leave the shell."
+
+ PS1="(RAID Repair) \# # "; export PS1
+ sulogin
+
+ echo "Unmounting file systems"
+ umount -arnf
+ mount -n -o remount,ro /
+ echo "Automatic reboot in progress."
+ reboot -f
+ fi
+fi
+
+# LVM Setting
+VGCHANGE=/sbin/vgchange
+if [ -x "$VGCHANGE" -a -s /etc/lvmtab ]; then
+ modprobe lvm-mod >/dev/null 2>&1
+ if [ -e /proc/lvm ]; then
+ action "Setting up LVM:" "$VGCHANGE" -a y
+ fi
+fi
+
# Set the system clock (when /etc/adjtime is missing).
[ -s /etc/adjtime ] || /etc/init.d/clock start
@@ -114,15 +183,6 @@
fsckoptions="-V $fsckoptions"
fi
-# LVM Setting
-VGCHANGE=/sbin/vgchange
-if [ -x "$VGCHANGE" -a -s /etc/lvmtab ]; then
- modprobe lvm-mod >/dev/null 2>&1
- if [ -e /proc/lvm ]; then
- action "Setting up LVM:" "$VGCHANGE" -a y
- fi
-fi
-
_RUN_QUOTACHECK=0
ROOTFSTYPE=`fgrep ' / ' /proc/mounts |tail -1 |cut -d' ' -f3`
if [ -z "$fastboot" -a "$ROOTFSTYPE" != nfs ]; then
@@ -263,66 +323,6 @@
setsysfont >/dev/null 2>&1 && SETSYSFONT_DONE=1 || SETSYSFONT_DONE=
fi
-# Activate EVMS
-EVMS_ACTIVE=
-STARTEVMS=/sbin/startevms
-if [ -x "$STARTEVMS" ] && ! fgrep -iwqs noevms /proc/cmdline; then
- action "Starting up EVMS:" "$STARTEVMS" init
- EVMS_ACTIVE=1
-fi
-
-# Add raid devices
-if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat -a -s /etc/raidtab ] && ! fgrep -iwqs noraidtab /proc/cmdline; then
- echo -n "Starting up RAID devices: "
-
- rc=0
-
- for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do
- RAIDDEV="${i##*/}"
- RAIDSTAT=`grep -s "^$RAIDDEV : active" /proc/mdstat`
- if [ -z "$RAIDSTAT" ]; then
- # Try raidstart first...if that fails then
- # fall back to raidadd, raidrun. If that
- # also fails, then we drop to a shell
- RESULT=1
- ExecIfExecutable /sbin/raidstart "$i"
- RESULT=$?
- if [ $RESULT -gt 0 ]; then
- ExecIfExecutable /sbin/raid0run "$i"
- RESULT=$?
- fi
- if [ $RESULT -gt 0 ]; then
- ExecIfExecutable /sbin/raidadd "$i"
- ExecIfExecutable /sbin/raidrun "$i"
- RESULT=$?
- fi
- if [ $RESULT -gt 0 ]; then
- rc=1
- fi
- fi
- echo -n "$RAIDDEV "
- done
- echo
-
- # A non-zero return means there were problems.
- if [ $rc -gt 0 ]; then
- echo
- echo
- echo "*** An error occurred during the RAID startup"
- echo "*** Dropping you to a shell; the system will reboot"
- echo "*** when you leave the shell."
-
- PS1="(RAID Repair) \# # "; export PS1
- sulogin
-
- echo "Unmounting file systems"
- umount -arnf
- mount -n -o remount,ro /
- echo "Automatic reboot in progress."
- reboot -f
- fi
-fi
-
_RUN_QUOTACHECK=0
# Check filesystems
# (pixel) do not check loopback files, will be done later (aren't available yet)