-
- # 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
+fi
+
+# 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
+
+# check for toram
+if grep -qs toram /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 [ "${NOPROMPT}" = "Yes" ]
+then
+ prompt=
+fi
+
+for path in $(which halt) $(which reboot) /etc/rc?.d /etc/default $(which stty) /bin/plymouth
+do
+ cache_path "${path}"
+done
+
+for x in $(cat /proc/cmdline)
+do
+ case ${x} in
+ quickreboot)
+ QUICKREBOOT="Yes"
+ ;;
+ esac
+done
+
+mount -o remount,ro /live/cow
+
+if [ -z ${QUICKREBOOT} ]
+then
+ # Exit if the system was booted from an ISO image rather than a physical CD
+ grep -qs find_iso= /proc/cmdline && return 0
+ # TODO: i18n
+ BOOT_DEVICE="$(get_boot_device)"
+
+ if device_is_USB_flash_drive ${BOOT_DEVICE}