diff -uNr rc.d.orig/init.d/halt rc.d/init.d/halt --- rc.d.orig/init.d/halt 2004-03-05 02:28:34 +1200 +++ rc.d/init.d/halt 2005-05-29 14:33:46 +1300 @@ -102,6 +102,14 @@ "Unmounting filesystem" \ "Unmounting filesystem (retry)" +# LVM Shutdown +VGCHANGE=/sbin/vgchange +if [ -x "$VGCHANGE" -a -s /etc/lvmtab ]; then + if [ -e /proc/lvm ]; then + action "Setting up LVM:" "$VGCHANGE" -a n + fi +fi + # Turn off raid. RAIDSTOP=/sbin/raidstop if [ -x "$RAIDSTOP" -a -f /etc/raidtab ]; then diff -uNr rc.d.orig/rc.sysinit rc.d/rc.sysinit --- rc.d.orig/rc.sysinit 2004-03-06 01:25:28 +1200 +++ rc.d/rc.sysinit 2005-05-29 14:29:13 +1300 @@ -81,6 +81,75 @@ # Set the system clock (when /etc/adjtime is missing). [ -s /etc/adjtime ] || /etc/init.d/clock start +# 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 + # Activate swapping. action "Activating swap partitions:" swapon -a -e @@ -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)