[Fedora-livecd-list] docs/livecd-iso-to-disk.pod tools/livecd-iso-to-disk.sh

Brian C. Lane bcl at fedoraproject.org
Thu Nov 11 17:26:29 UTC 2010


 docs/livecd-iso-to-disk.pod |    8 ++++++++
 tools/livecd-iso-to-disk.sh |   22 ++++++++++++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit 0df0c8c27d9aa44c313aea24a240e22ff5db571d
Author: Brian C. Lane <bcl at redhat.com>
Date:   Tue Nov 9 16:39:57 2010 -0800

    Add support for timeout and totaltimeout to livecd-iso-to-disk (#531566)
    
    Allow editing of the bootloader config file's timeout and totaltimeout
    settings.

diff --git a/docs/livecd-iso-to-disk.pod b/docs/livecd-iso-to-disk.pod
index bbb54f2..1ccab66 100644
--- a/docs/livecd-iso-to-disk.pod
+++ b/docs/livecd-iso-to-disk.pod
@@ -52,6 +52,14 @@ The intended use of this option is to speed up testing of the boot configuration
 
 Create a GPT partition table when --format is passed, and install an hybrid EFI/MBR bootloader on the disk. This is necessary for most Intel Macs.
 
+=item --timeout
+
+Modify the bootloader's timeout value. This overrides the value set during iso creation. Units are 1/10s
+
+=item --totaltimeout
+
+Add a totaltimeout to the bootloader config. This is used to force and automatic boot. This cannot be canceled by the user. Units are 1/10s
+
 =back
 
 =head1 CONTRIBUTORS
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 72211d2..2303209 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -23,7 +23,7 @@
 export PATH=/sbin:/usr/sbin:$PATH
 
 usage() {
-    echo "$0 [--format] [--reset-mbr] [--noverify] [--overlay-size-mb <size>] [--home-size-mb <size>] [--unencrypted-home] [--skipcopy] [--efi] <isopath> <usbstick device>"
+    echo "$0 [--timeout <time>] [--totaltimeout <time>] [--format] [--reset-mbr] [--noverify] [--overlay-size-mb <size>] [--home-size-mb <size>] [--unencrypted-home] [--skipcopy] [--efi] <isopath> <usbstick device>"
     exit 1
 }
 
@@ -452,6 +452,16 @@ while [ $# -gt 2 ]; do
 	--multi)
 	    multi=1
 	    ;;
+        --timeout)
+            checkint $2
+            timeout=$2
+            shift
+            ;;
+        --totaltimeout)
+            checkint $2
+            totaltimeout=$2
+            shift
+            ;;
 	*)
 	    echo "invalid arg -- $1"
 	    usage
@@ -487,7 +497,7 @@ if [ -z "$noverify" ]; then
     fi
 fi
 
-checkFilesystem $USBDEV
+#checkFilesystem $USBDEV
 # do some basic sanity checks.  
 checkMounted $USBDEV
 if [ -n "$format" -a -z "$skipcopy" ];then
@@ -707,6 +717,14 @@ if [ "$isotype" = "netinst" ]; then
   sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
 fi
 
+# Adjust the boot timeouts
+if [ -n "$timeout" ]; then
+    sed -i -e "s/^timeout.*$/timeout\ $timeout/" $BOOTCONFIG
+fi
+if [ -n "$totaltimeout" ]; then
+    sed -i -e "/^timeout.*$/a\totaltimeout\ $totaltimeout" $BOOTCONFIG
+fi
+
 # Use repo if the .iso has the repository on it, otherwise use stage2 which
 # will default to using the network mirror
 if [ -e "$CDMNT/.discinfo" ]; then




More information about the livecd mailing list