From 5745a8d824857b90bd5e25478226570d8e805c95 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 27 Feb 2013 19:05:39 +0100 Subject: Add build profiles to target 'tools' (-p switch) --- mltk | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'mltk') diff --git a/mltk b/mltk index 6b18e187..cb4a74cc 100755 --- a/mltk +++ b/mltk @@ -45,25 +45,28 @@ 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}) tools [-d] [-c [module]*] [-b [module]*] [-p profile]" + echo " $(basename ${SELF}) core [-d] [-c] [-b]" 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 "" echo -e " Target options:" - echo -e " -b \t build current target" - echo -e " -c \t clean current target" - echo -e " -d \t activates debug output for current target" + echo -e " -b build target" + echo -e " -c clean target" + echo -e " -d activates debug output for current target" + echo -e " -p profile build all modules from given profile" echo -e "" - echo -e " For target tools, you can pass names of specific modules to clean/build." + echo -e " For target 'tools', you can pass names of specific modules to clean/build." 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 " 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 " 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 " tools -c -p default (clean all tools, build modules listed in profile default)" + echo -e " core -c -b (clean and build core)" echo -e "" echo -e " Existing modules for tools are:" echo -e " $(echo $(ls ${ROOT_DIR}/remote/tools))" @@ -121,6 +124,16 @@ read_params() { eval ${MODE}_DEBUG="1" continue ;; + -p) + [ "$#" -lt "1" ] && perror "Missing argument to -p" + [ "$MODE" != "TOOLS" ] && perror "-p can only be used for target tools" + . "profiles/${1}.profile" || perror "Profile '$1' not found in profiles/" + TOOLS_BUILD="1" + TOOLS_LIST_BUILD="$TOOLS_LIST_BUILD $MODULES" + unset MODULES + shift + continue + ;; *) pwarning "Unknown flag to target: $PARAM" print_usage -- cgit v1.2.3-55-g7522