diff options
-rwxr-xr-x | mltk | 31 | ||||
-rw-r--r-- | profiles/default.profile | 10 |
2 files changed, 32 insertions, 9 deletions
@@ -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 diff --git a/profiles/default.profile b/profiles/default.profile new file mode 100644 index 00000000..8bda62c5 --- /dev/null +++ b/profiles/default.profile @@ -0,0 +1,10 @@ +# All modules that should be included in this profile +MODULES=" + base + busybox + dbus + systemd + ldm + ldm-gtk-greeter +" + |