From 274ce8e4e2b902e4e7b4871c284cee0285cf18a6 Mon Sep 17 00:00:00 2001 From: "T(A)ILS developers" Date: Mon, 9 Aug 2010 20:48:17 +0200 Subject: [PATCH] Adding noprompt={usb,cd} feature. --- debian/live-boot.init | 13 ++++++++++++- manpages/en/live-boot.7 | 2 ++ scripts/live | 10 ++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/debian/live-boot.init b/debian/live-boot.init index 1a85267..dd338b1 100644 --- a/debian/live-boot.init +++ b/debian/live-boot.init @@ -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 diff --git a/manpages/en/live-boot.7 b/manpages/en/live-boot.7 index 1d0d45b..71e15b4 100644 --- a/manpages/en/live-boot.7 +++ b/manpages/en/live-boot.7 @@ -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 diff --git a/scripts/live b/scripts/live index 5daec7f..c5f4d50 100755 --- a/scripts/live +++ b/scripts/live @@ -266,6 +266,16 @@ Arguments () export NOPERSISTENT ;; + noprompt) + NOPROMPT="Yes" + export NOPROMPT + ;; + + noprompt=*) + NOPROMPT="${ARGUMENT#noprompt=}" + export NOPROMPT + ;; + quickusbmodules) QUICKUSBMODULES="Yes" export QUICKUSBMODULES -- 2.1.4