From: Ulrich Dangel Date: Sat, 12 Feb 2011 12:40:21 +0000 (+0100) Subject: Allow multiple --bootoptions for grml2usb. This makes scripting a lot easier. X-Git-Tag: v0.9.31~3 X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=commitdiff_plain;h=cc12ab635f2b0586aa212899a123c851eb05d076;ds=inline Allow multiple --bootoptions for grml2usb. This makes scripting a lot easier. --- diff --git a/grml2usb b/grml2usb index 9191e85..ac913c0 100755 --- a/grml2usb +++ b/grml2usb @@ -60,7 +60,7 @@ Run %prog --help for usage hints, further information via: man grml2usb" # pylint: disable-msg=W0603 parser = OptionParser(usage=USAGE) parser.add_option("--bootoptions", dest="bootoptions", - action="store", type="string", + action="append", type="string", help="use specified bootoptions as default") parser.add_option("--bootloader-only", dest="bootloaderonly", action="store_true", help="do not copy files but just install a bootloader") @@ -1593,10 +1593,10 @@ def get_bootoptions(grml_flavour): @grml_flavour: name of the grml_flavour """ # do NOT write "None" in kernel cmdline - if options.bootoptions is None: + if not options.bootoptions: bootopt = "" else: - bootopt = options.bootoptions + bootopt = " ".join(options.bootoptions) bootopt = bootopt.replace("%flavour", grml_flavour) return bootopt diff --git a/grml2usb.8.txt b/grml2usb.8.txt index 59c5627..91fd1b2 100644 --- a/grml2usb.8.txt +++ b/grml2usb.8.txt @@ -52,7 +52,8 @@ The following options are supported: *\--bootoptions=...*:: Use specified bootoptions as default. To use flavour name as a argument for a -boot parameter use %flavour which will be expanded to the flavour name. +boot parameter use %flavour which will be expanded to the flavour name. To add +multiple bootoptions you can specify the option multiple time. *\--bootloader-only*:: @@ -646,6 +647,7 @@ file instead of the one provided by the ISO. /////////////////////////////////////////////////////////////////////////////////////// # grml2usb --bootoptions="lang=de ssh=mysecret" grml_2009.10.iso /dev/sdX1 + # grml2usb --bootoptions="lang=de" --bootoptions="ssh=mysecret" grml_2009.10.iso /dev/sdX1 Install specified ISO on device /dev/sdX1 and use "lang=de ssh=mysecret" as default bootoptions.