From 2266f345c252fe8a13b8620d1e788ad359929481 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Fri, 23 Oct 2009 19:59:00 +0200 Subject: [PATCH] rc: removed waste as switch_root never returns --- initramfs/etc_rc.d_rc.switchroot.sh | 36 +++++++---------------------- initramfs/init.sh | 21 +++-------------- 2 files changed, 11 insertions(+), 46 deletions(-) diff --git a/initramfs/etc_rc.d_rc.switchroot.sh b/initramfs/etc_rc.d_rc.switchroot.sh index 23ed575..69975e2 100644 --- a/initramfs/etc_rc.d_rc.switchroot.sh +++ b/initramfs/etc_rc.d_rc.switchroot.sh @@ -16,32 +16,12 @@ . /etc/rc.d/functions.in . /etc/conf/idunn -case "$1" in -stop) - title "Stoping network interfaces" - check unet down - status +title "Stoping network interfaces" +check unet down +status - title "Moving special filesystems" - for x in dev sys proc; do - check mount -o move "/$x" "$rootfs/$x" - done - status - - ;; -revive) - title "Moving special filesystems back" - for x in dev sys proc; do - check mount -o move "$rootfs/$x" "/$x" - done - status - - title "Restarting network interfaces" - check unet up - status - - title "Restarting Supervisor" - check start-stop-daemon -S -b -x /usr/bin/runsvdir -- /var/service/ - status - ;; -esac +title "Moving special filesystems" +for x in dev sys proc; do + check mount -o move "/$x" "$rootfs/$x" +done +status diff --git a/initramfs/init.sh b/initramfs/init.sh index 8a1b35a..bcf3043 100644 --- a/initramfs/init.sh +++ b/initramfs/init.sh @@ -63,27 +63,12 @@ while true; do echo "switch_root in progress, you will be disconnected now." | wall # stop services - /etc/rc.d/rc.shutdown 2>&1 | tee -a $LOG + /etc/rc.d/rc.shutdown # terminate the rest - /etc/rc.d/rc.switchroot stop 2>&1 | tee -a $LOG + /etc/rc.d/rc.switchroot stop # and proceed - exec switch_root -c /dev/console "$rootfs" "$init" $initopt 2>&1 >> $LOG - errno=$? - - # outch! what are we doing here? - if [ ! -s $LOG ]; then - # the world is gone, time to panic - exit $errno - else - cat <<-EOT >> $LOG - switch_root failed returning $errno - - EOT - rm -f /var/run/.idunn-resume - - /etc/rc.d/rc.switchroot revive 2>&1 | tee -a $LOG - fi + exec switch_root -c /dev/console "$rootfs" "$init" $initopt fi done