+ # check for netboot
+ if [ ! -z "${NETBOOT}" ] || grep -qs netboot /proc/cmdline || grep -qsi root=/dev/nfs /proc/cmdline || grep -qsi root=/dev/cifs /proc/cmdline
+ then
+ return 0
+ fi
+
+ # Don't prompt to eject the SD card on Babbage board, where we reuse it
+ # as a quasi-boot-floppy. Technically this uses a bit of ubiquity
+ # (archdetect), but since this is mostly only relevant for
+ # installations, who cares ...
+ if type archdetect >/dev/null 2>&1
+ then
+ subarch="$(archdetect)"
+
+ case $subarch in
+ arm*/imx51)
+ return 0
+ ;;
+ esac
+ fi
+
+ prompt=1
+ if grep -qs noprompt /proc/cmdline
+ then
+ prompt=
+ fi
+
+ for path in $(which halt) $(which reboot) /etc/rc?.d /etc/default $(which stty)
+ do
+ cache_path "${path}"
+ done
+
+ for x in $(cat /proc/cmdline)
+ do
+ case ${x} in
+ quickreboot)
+ QUICKREBOOT="Yes"
+ ;;
+ esac
+ done
+
+ if [ -z ${QUICKREBOOT} ]
+ then
+ # TODO: i18n
+ BOOT_DEVICE="$(get_boot_device)"
+
+ if device_is_USB_flash_drive ${BOOT_DEVICE}
+ then
+ # do NOT eject USB flash drives!
+ # otherwise rebooting with most USB flash drives
+ # failes because they actually remember the
+ # "ejected" state even after reboot
+ MESSAGE="Please remove the USB flash drive"
+ else
+ # ejecting is a very good idea here
+ MESSAGE="Please remove the disc, close the the tray (if any)"
+
+ if [ -x /usr/bin/eject ]
+ then
+ eject -p -m /live/image >/dev/null 2>&1
+ fi
+
+ fi
+
+ [ "$prompt" ] || return 0
+
+ if [ -x /bin/plymouth ] && plymouth --ping
+ then
+ plymouth message --text="${MESSAGE} and press ENTER to continue:"
+ plymouth watch-keystroke > /dev/null
+ else
+ stty sane < /dev/console
+
+ printf "\n\n${MESSAGE} and press ENTER to continue:" > /dev/console
+
+ if [ -x /sbin/usplash_write ]
+ then
+ /sbin/usplash_write "TIMEOUT 86400"
+ /sbin/usplash_write "TEXT-URGENT ${MESSAGE}"
+ /sbin/usplash_write "TEXT-URGENT and press ENTER to continue"
+ fi
+
+ read x < /dev/console
+ fi
+ fi