# Authors: grml-team (grml.org), (c) Klaus Knopper, (c) Michael Prokop <mika@grml.org>
# 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
# Check if we are running from a GRML-CD or HD
INSTALLED=""
-[ -e /GRML/etc/grml_cd ] || INSTALLED=yes
+[ -e /etc/grml_cd ] || INSTALLED=yes
# Assume that we don't want the eject+prompt stuff when running in one
# of the special modes:
grep -qe ' toram' -qe ' usb' -qe 'serial' -qe 'fromhd' /proc/cmdline && INSTALLED=yes
# Disable kernel messages
echo "0" > /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
fi
if [ -n "$INSTALLED" ] ; then
- echo
log_begin_msg_nn "Running /etc/init.d/rc ${level}: "
/etc/init.d/rc $level 1>/dev/null 2>&1 &
mysleep "$GREEN"
# 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
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