diff options
author | Simon Rettberg | 2013-02-27 17:38:18 +0100 |
---|---|---|
committer | Simon Rettberg | 2013-02-27 17:38:18 +0100 |
commit | 87f6542aed5d76c5e781cddb03a9dab284f9f454 (patch) | |
tree | af1c09affc7af73fdffafbfdbe92f6008405abf1 /mltk | |
parent | Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff) | |
download | tm-scripts-87f6542aed5d76c5e781cddb03a9dab284f9f454.tar.gz tm-scripts-87f6542aed5d76c5e781cddb03a9dab284f9f454.tar.xz tm-scripts-87f6542aed5d76c5e781cddb03a9dab284f9f454.zip |
Only one target can be chosen when invoking mltk to make command line format more compatible to previous versions
Diffstat (limited to 'mltk')
-rwxr-xr-x | mltk | 52 |
1 files changed, 24 insertions, 28 deletions
@@ -45,11 +45,11 @@ banner () { print_usage() { echo "Toolkit for creating preboot mini-linux for OpenSLX NG (mltk)" - echo "Usage: $(basename ${SELF}) --[target] [-b] [-c] [-d] [module]*" + echo "Usage: $(basename ${SELF}) [target] [-b] [-c] [-d] [module]*" echo -e "" echo -e " Target:" - echo -e " --core \t minimal initramfs (stage 3.1) to mount the system-container (stage 3.2)." - echo -e " --tools \t minimal systemd-based rootfs including basic tools (required for --core)." + echo -e " core \t minimal initramfs (stage 3.1) to mount the system-container (stage 3.2)." + echo -e " tools \t minimal systemd-based rootfs including basic tools (required for core)." echo -e "" echo -e " Target options:" echo -e " -b \t build current target" @@ -60,11 +60,12 @@ print_usage() { echo -e " Otherwise, all modules will be built/cleaned." echo -e "" echo -e " Examples:" - echo -e " --tools -c -b base policykit sshd (clean all tools, build base, policykit and sshd)" - echo -e " --core -c -b --tools -c -b (clean all tools, build all tools, clean core, build core)" - echo -e " --tools -c base sshd -b sshd, ldm (clean base and sshd, build sshd and ldm, be verbose)" + echo -e " tools -c -b base policykit sshd (clean all tools, build base, policykit and sshd)" + echo -e " tools -c -b (clean all tools, build all tools)" + echo -e " tools -c base sshd -b sshd ldm -d (clean base and sshd, build sshd and ldm, be verbose)" + echo -e " core -c -b (clean and build core)" echo -e "" - echo -e " Existing modules for --tools are:" + echo -e " Existing modules for tools are:" echo -e " $(echo $(ls ${ROOT_DIR}/remote/tools))" } @@ -87,31 +88,26 @@ initial_checks() { read_params() { local MODE="" local SUBMODE="" + # select target: core or tools + case "$1" in + core) + MODE="CORE" + ;; + tools) + MODE="TOOLS" + ;; + *) + pwarning "Unknown target: $1" + print_usage + exit 1 + ;; + esac + shift + # handle rest of arguments while [ "$#" -gt "0" ]; do local PARAM="$1" shift - # select target: core or tools - if [[ "$PARAM" == "--"* ]]; then - case "$PARAM" in - --core) - MODE="CORE" - ;; - --tools) - MODE="TOOLS" - ;; - *) - pwarning "Unknown target: $PARAM" - print_usage - exit 1 - ;; - esac - SUBMODE="" - continue - fi - - [ "x$MODE" = "x" ] && pwarning "Cannot handle param $PARAM - no target selected yet" && print_usage && exit 1 - # options to current target if [[ "$PARAM" == "-"* ]]; then case "$PARAM" in |