diff options
author | Jonathan Bauer | 2013-03-14 14:22:20 +0100 |
---|---|---|
committer | Jonathan Bauer | 2013-03-14 14:22:20 +0100 |
commit | 2a94d11a5525f66698678a76f1341831b2e622f7 (patch) | |
tree | d68bf6ae8b5f9c227002c0e8c4bfafb9c48160d8 /remote/setup_tools | |
parent | Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff) | |
download | tm-scripts-2a94d11a5525f66698678a76f1341831b2e622f7.tar.gz tm-scripts-2a94d11a5525f66698678a76f1341831b2e622f7.tar.xz tm-scripts-2a94d11a5525f66698678a76f1341831b2e622f7.zip |
new arguments for mltk, see manpages & changed INIT_DIR to TARGET_BUILD DIR
Diffstat (limited to 'remote/setup_tools')
-rwxr-xr-x | remote/setup_tools | 63 |
1 files changed, 24 insertions, 39 deletions
diff --git a/remote/setup_tools b/remote/setup_tools index a009fdff..4e118a18 100755 --- a/remote/setup_tools +++ b/remote/setup_tools @@ -1,32 +1,22 @@ #!/bin/bash -MODULE_DIR="${ROOT_DIR}/remote" +MODE_DIR="${ROOT_DIR}/remote" #Create tools directory if not exists -TOOL_DIR="${MODULE_DIR}/tools" -INIT_DIR="${MODULE_DIR}/stage3.2" +TOOL_DIR="${MODE_DIR}/tools" +INIT_DIR="${MODE_DIR}/stage3.2" # Keep track of processed modules PROCESSED_MODULES="" initial_checks () { - - # check for target directory - [ -d $TARGET ] || perror "Given target directory does not exist: $TARGET" - [[ $TARGET == "${MODULE_DIR}"/build || $TARGET == "${MODULE_DIR}"/modules ]] && \ - perror "Target directory 'modules' invalid, used internally." - - # check for required tools for BIN in git locate do local TEST=$(which ${BIN}) [ -z "$TEST" ] && pinfo "Installing $BIN..." && apt-get install $BIN done - - - } @@ -141,41 +131,36 @@ copyfileswithdependencies () { generate_target() { - [ "x$1" = "xstage31" -o "x$1" = "xstage32" ] || perror "generate_stage requires 'stage31' or 'stage32', but $1 given." - initial_checks - - TARGET_DIR="${MODULE_DIR}/build/$1" - - # copy basic libs - tarcopy "$(list_basic_libs)" "${MODULE_DIR}/build/$1" - - # if no arguments assume all. - if [ "x$1" = "x" -o "x$1" = "xall" ]; then - tools=$(ls ${TOOL_DIR}) - set -- $tools - fi + [[ $TARGET == build || $TARGET == modules ]] && \ + perror "Target directory cannot be named 'build' nor 'modules'." - # now iterate over given tools and copy them - while (( "$#" )); do - process_module "$1" - shift - done - TOOL_STR="" -} + # check for target directory + TARGET_DIR="${MODE_DIR}/${TARGET}" + [ -d $TARGET_DIR ] || perror "Given target directory does not exist: $TARGET" -generate_stage32 () { + TARGET_BUILD_DIR="${MODE_DIR}/build/${TARGET}" - initial_checks + pinfo "Generating '$TARGET_BUILD_DIR' for '$TARGET'" - tarcopy "$(list_basic_libs)" "${INIT_DIR}" + INIT_DIR=${TARGET_BUILD_DIR} # if no arguments assume all. if [ "x$1" = "x" -o "x$1" = "xall" ]; then - tools=$(ls ${TOOL_DIR}) - set -- $tools - fi + MODULES=$(ls ${TARGET_DIR}) + set -- $MODULES + else + # tools = arguments given + MODULES=$@ + fi + + pinfo "Activated modules in '${TARGET}':" + pinfo "\t$(echo ${MODULES})" + + # copy basic libs + pinfo "Copying libc and ld-linux used by ${SHELL}" + tarcopy "$(list_basic_libs)" "${TARGET_BUILD_DIR}" # now iterate over given tools and copy them while (( "$#" )); do |