From f5403b2f0d158db4573c91e797b311e2173df8b7 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 30 Apr 2014 10:09:09 +0200 Subject: [PATCH] Made source image and target directory configurable in create-grml-squash.sh --- create-grml-squash.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/create-grml-squash.sh b/create-grml-squash.sh index 40e36c7..eb74640 100755 --- a/create-grml-squash.sh +++ b/create-grml-squash.sh @@ -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 -- 2.39.5