Adding noprompt={usb,cd} feature.
authorT(A)ILS developers <amnesia@boum.org>
Mon, 9 Aug 2010 18:48:17 +0000 (20:48 +0200)
committerDaniel Baumann <daniel@debian.org>
Wed, 9 Mar 2011 16:59:20 +0000 (17:59 +0100)
debian/live-boot.init
manpages/en/live-boot.7
scripts/live

index 1a85267..dd338b1 100644 (file)
@@ -136,7 +136,7 @@ do_stop ()
        fi
 
        prompt=1
-       if grep -qs noprompt /proc/cmdline
+       if [ ${NOPROMPT} = "Yes" ]
        then
                prompt=
        fi
@@ -170,6 +170,12 @@ do_stop ()
                        # failes because they actually remember the
                        # "ejected" state even after reboot
                        MESSAGE="Please remove the USB flash drive"
+
+                       if [ ${NOPROMPT} = "usb" ]
+                       then
+                               prompt=
+                       fi
+
                else
                        # ejecting is a very good idea here
                        MESSAGE="Please remove the disc, close the the tray (if any)"
@@ -179,6 +185,11 @@ do_stop ()
                                eject -p -m /live/image >/dev/null 2>&1
                        fi
 
+                       if [ ${NOPROMPT} = "cd" ]
+                       then
+                               prompt=
+                       fi
+
                fi
 
                [ "$prompt" ] || return 0
index 1d0d45b..71e15b4 100644 (file)
@@ -98,6 +98,8 @@ This parameter disables the default disabling of filesystem checks in /etc/fstab
 disables the "persistent" feature, useful if the bootloader (like syslinux) has been installed with persistent enabled.
 .IP "\fBnoprompt\fR" 4
 Do not prompt to eject the CD or remove the USB flash drive on reboot.
+.IP "\fBnoprompt\fR=\fITYPE\fR" 4
+This tells live-boot not to prompt to eject the CD (when noprompt=cd) or remove the USB flash drive (when noprompt=usb) on reboot.
 .IP "\fBswapon\fR" 4
 This parameter enables usage of local swap partitions.
 .IP "\fBpersistent\fR[={nofiles|cryptsetup}]" 4
index 5daec7f..c5f4d50 100755 (executable)
@@ -266,6 +266,16 @@ Arguments ()
                                export NOPERSISTENT
                                ;;
 
+                       noprompt)
+                               NOPROMPT="Yes"
+                               export NOPROMPT
+                               ;;
+
+                       noprompt=*)
+                               NOPROMPT="${ARGUMENT#noprompt=}"
+                               export NOPROMPT
+                               ;;
+
                        quickusbmodules)
                                QUICKUSBMODULES="Yes"
                                export QUICKUSBMODULES