X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Finit.d%2Fgrml-reboot;h=0b735a9eea414d1947fc82da953ba9cf16612f38;hb=9f6a142c655f2965205623219797c43e29dd3efc;hp=ebc91730cbafe4679117656a449e956c28dd55a5;hpb=699350f077f1bf4eb7e47ae940e0503129ad81b5;p=grml-etc.git diff --git a/etc/init.d/grml-reboot b/etc/init.d/grml-reboot index ebc9173..0b735a9 100755 --- a/etc/init.d/grml-reboot +++ b/etc/init.d/grml-reboot @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Klaus Knopper, (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Die Jun 26 00:08:30 CEST 2007 [mika] +# Latest change: Mon Mär 10 18:45:36 CET 2008 [mika] ################################################################################ export PATH=/sbin:/bin:/usr/bin:/usr/sbin @@ -19,7 +19,7 @@ exec >/dev/console 2>&1 /proc/sys/kernel/printk +# make sure halt/reboot commands are available even if +# someone is using shutdown command: +cat /sbin/halt /sbin/reboot >/dev/null + # We may kill our network connection here before unmounting NFS. Bad luck. # poweroff pcmcia devices if [ -d /sys/bus/pcmcia -a -x /sbin/pccardctl ] ; then @@ -148,7 +152,12 @@ fi # Detected cdrom device if [ -z "$INSTALLED" ]; then - CDROM="$(awk '/ \/cdrom /{print $1;exit 0;}' /proc/mounts)" + # new live-initramfs layout: + if [ -d /live/image ] ; then + CDROM="$(awk '/ \/live\/image /{print $1;exit 0;}' /proc/mounts)" + else # old unionfs layout: + CDROM="$(awk '/ \/cdrom /{print $1;exit 0;}' /proc/mounts)" + fi fi # Umount everything but root @@ -175,10 +184,11 @@ log_end_msg 0 if [ -z "$INSTALLED" -a -z "$NOPROMPT" ]; then # do not prompt for removal when running in grml2ram mode: - if ! mount | grep -q 'on /cdrom ' ; then + if ! mount | grep -qe 'on /cdrom' -qe 'on /live/image' ; then echo "CD not mounted, nothing to eject therefore." else - umount -l /cdrom + [ -d /live/image ] && umount -l /live/image + [ -d /cdrom ] && umount -l /cdrom [ -n "$CDROM" -a -z "$NOEJECT" ] && eject -p "$CDROM" 2>/dev/null echo read -s -p "${GREEN}Please remove CD, close cdrom drive and hit return [auto 2 minutes].${NORMAL}" -t 120 a