]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
Made source image and target directory configurable in create-grml-squash.sh
authorFrank Brehm <frank.brehm@profitbricks.com>
Wed, 30 Apr 2014 08:09:09 +0000 (10:09 +0200)
committerFrank Brehm <frank.brehm@profitbricks.com>
Wed, 30 Apr 2014 08:09:09 +0000 (10:09 +0200)
create-grml-squash.sh

index 40e36c7f35bf733463b86e887c79ef4f888f8a40..eb74640b22e5328f99baccb0a05d87b31d260c51 100755 (executable)
@@ -50,8 +50,6 @@ fi
 
 ORIG_IMG="/mnt/grml/live/grml64-full/grml64-full.squashfs"
 TARGET_DIR="/var/tmp/grml"
-#LOCAL_NAMESERVERS="192.168.178.30 192.168.178.89"
-#LOCAL_SEARCH_DOMAINS="pb.local dc1.de.profitbricks.net dc2.us.profitbricks.net"
 
 PACKAGES="infiniband-diags opensm bc git libpcre3 mbuffer lsscsi bind9-host bind9utils"
 
@@ -149,6 +147,11 @@ Usage: ${MY_BASE} [Options ...]
 This script creates a GRML squashfs usable for netboot.
 
 Options:
+    -S|--source IMG original source GRML squashfs image (Default: ${ORIG_IMG})
+                    Note: it must exists and may not lay inside the target directory
+    -T|--target DIR target working directory (Default: ${TARGET_DIR})
+                    Note: if existing before, it will be erased completely
+                          on starting this script.
     -d|--debug      debug output (sh -x)
     -v|--verbose    more verbose output
     -t|--test       test/simulation mode, nothing is really done
@@ -161,8 +164,8 @@ EOF
 # Reading command line stuff
 do_getopt() {
 
-    local TEMP=$( getopt -o dvthyV \
-                  --long debug,verbose,test,help,yes,version \
+    local TEMP=$( getopt -o S:T:dvthyV \
+                  --long source:,target:,debug,verbose,test,help,yes,version \
                   -n "${MY_BASE}" -- "$@" )
     if [[ $? != 0 ]] ; then
         error "Terminating because of wrong arguments ..." >&2
@@ -174,6 +177,16 @@ do_getopt() {
 
     while true; do
         case "$1" in
+            -S|--source)
+                ORIG_IMG="$2"
+                shift
+                shift
+                ;;
+            -T|--target)
+                TARGET_DIR="$2"
+                shift
+                shift
+                ;;
             -d|--debug)
                 debug="y"
                 shift