X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Finit.d%2Fgrml-reboot;h=c88f71f048ac48c52cd488c54c9c70157e82c154;hb=b6dcc1d84bde6106bbee24de3158176452ca3600;hp=7f14558abe01527f9726f3f437a021c6ad5ef88c;hpb=269109801453d1c66dce4855bdb94f571883e335;p=grml-etc.git diff --git a/etc/init.d/grml-reboot b/etc/init.d/grml-reboot index 7f14558..c88f71f 100755 --- a/etc/init.d/grml-reboot +++ b/etc/init.d/grml-reboot @@ -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? @@ -79,8 +79,8 @@ case "$0" in esac mysleep() { - for i in $(seq 1 40) ; do - usleep 75000 + for i in $(seq 1 30) ; do + sleep 0.1 echo -n "$1.${NORMAL}" done echo "" @@ -149,6 +149,13 @@ esac [ -r /etc/noprompt ] && NOPROMPT=true [ -r /etc/noeject ] && NOPROMPT=true && NOEJECT=true +VIRT_WHAT=$(/usr/sbin/virt-what 2>/dev/null) +if [ -n "$VIRT_WHAT" ] ; then + log_begin_msg "System seems to be a virtual machine, assuming noprompt as default." + NOPROMPT=true + log_end_msg 0 +fi + # Turn on autoeject of CD-ROMs if $NOEJECT ; then for dev in /proc/sys/dev/cdrom*/lock; do [ -f "$dev" ] && echo 0 > "$dev"; done