X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Finit.d%2Fgrml-reboot;h=157d04f8ee821809292e84cc69c84c3085724942;hb=refs%2Fheads%2Ft%2Fgrml-core;hp=7f14558abe01527f9726f3f437a021c6ad5ef88c;hpb=269109801453d1c66dce4855bdb94f571883e335;p=grml-etc.git diff --git a/etc/init.d/grml-reboot b/etc/init.d/grml-reboot index 7f14558..157d04f 100755 --- a/etc/init.d/grml-reboot +++ b/etc/init.d/grml-reboot @@ -8,6 +8,7 @@ export PATH=/sbin:/bin:/usr/bin:/usr/sbin +. /usr/lib/grml/core.sh . /etc/grml_colors . /etc/grml/lsb-functions @@ -23,16 +24,15 @@ REMOVABLE=false USB_DEVICE=false NOPROMPT=${NOPROMPT:-false} NOEJECT=${NOEJECT:-false} -CMDLINE="$(cat /proc/cmdline 2>/dev/null)" # Check if we are running from a GRML-CD or HD [ -e /etc/grml_cd ] || INSTALLED=true # Assume that we don't want the eject+prompt stuff when running in one # of the special modes: -grep -qe 'toram' -qe '2ram' -qe 'usb' -qe 'serial' \ - -qe 'fromhd' -qe 'isofrom' -qe 'fromiso' -qe 'findiso' \ - /proc/cmdline && INSTALLED=true +checkbootparam 'toram' || checkbootparam '2ram' || checkbootparam 'usb' \ +checkbootparam 'serial' || checkbootparam 'fromhd' || checkbootparam 'isofrom' \ +checkbootparam 'fromiso' || checkbootparam 'findiso' && INSTALLED=true # detect cdrom device if ! $INSTALLED ; then @@ -49,7 +49,7 @@ if ! $INSTALLED ; then DEVICE="" if [ -n "$CDROM" ] ; then DEVICE="${CDROM##/dev/}" - DEVICE="${DEVICE%%[0-9]*}" + [ -d /sys/block/${DEVICE} ] || DEVICE="${DEVICE%%[0-9]*}" if [ -n "$DEVICE" ] ; then # is it a removable device?