summaryrefslogtreecommitdiffstats
path: root/mltk
diff options
context:
space:
mode:
authorJonathan Bauer2012-12-20 15:33:34 +0100
committerJonathan Bauer2012-12-20 15:33:34 +0100
commitf6dad6269ab3228ead055291b846d2a9edb04564 (patch)
tree30096a5fbd037fe4f9f0a0ef2b68d04317883c8e /mltk
parentstatic unit files for dbus, cleanup (diff)
downloadtm-scripts-f6dad6269ab3228ead055291b846d2a9edb04564.tar.gz
tm-scripts-f6dad6269ab3228ead055291b846d2a9edb04564.tar.xz
tm-scripts-f6dad6269ab3228ead055291b846d2a9edb04564.zip
mltk basic script :)
Diffstat (limited to 'mltk')
-rwxr-xr-xmltk58
1 files changed, 58 insertions, 0 deletions
diff --git a/mltk b/mltk
index 10c772b2..3af41ce5 100755
--- a/mltk
+++ b/mltk
@@ -19,4 +19,62 @@
SELF=$(readlink -f $0)
ROOT_DIR=$(dirname ${SELF})
+print_usage() {
+ echo "Toolkit for creating preboot mini-linux for OpenSLX NG (mltk)"
+ echo "Usage: $(basename ${SELF}) MODULE [OPTION]"
+ echo -e " MODULE:"
+ echo -e " \t core \t minimal initramfs (stage 3.1) to mount the system-container (stage 3.2)."
+ echo -e " \t sys \t minimal systemd-based rootfs including basic tools."
+ echo -e " OPTION:"
+ echo -e " \t build \t builds [MODULE]"
+ echo -e " \t clean \t clean build files for [MODULE]"
+ echo -e ""
+ echo -e " Module specific option:"
+ echo -e " \t sys \t build [TOOL]"
+ echo -e " \t \t TOOL can be: \t base, busybox, dbus, udev, systemd, plymouth"
+}
+if [ "x$1" = "x" ]; then
+ print_usage
+ exit 0
+elif [ "x$(whoami)" != "xroot" ]; then
+ echo "ERROR: You need to have root rights to install packages."
+ exit 1
+fi
+
+# read setup-tools and build_core
+BUILD_CORE=${ROOT_DIR}/server/build_core
+SETUP_TOOLS=${ROOT_DIR}/remote/setup_tools
+
+if [ "x$1" = "xcore" ]; then
+ [ -e ${BUILD_CORE} ] && . ${BUILD_CORE}
+ shift
+ if [ "x$1" = "xbuild" ]; then
+ generate_stage31
+ elif [ "x$1" = "xclean" ]; then
+ clean_core
+ else
+ print_usage
+ exit 1
+ fi
+elif [ "x$1" = "xsys" ]; then
+ [ -e ${SETUP_TOOLS} ] && . ${SETUP_TOOLS}
+ shift
+ if [ "x$1" = "xbuild" ]; then
+ # shift away first 2 parameters
+ shift
+ echo "[sys] Building $@"
+ generate_stage32 $@
+ elif [ "x$1" = "xclean" ]; then
+ shift
+ echo "[sys] Cleaning $@"
+ clean_sys $@
+ else
+ print_usage
+ exit 1
+ fi
+else
+ echo "Module $1 not known."
+ print_usage
+ exit 1
+fi