From 97b4ba82596ae5484079483afeaba7986958ecab Mon Sep 17 00:00:00 2001 From: Michael Neves Date: Wed, 20 Mar 2013 15:22:51 +0100 Subject: KERNEL_VERSION from system.inc gitignore and calc_size in fileutil calculates the build size of a module fix generate_target argument parsing add xfs to rootfs-stage31.conf added server sync option -s - Fix sshd module failing to set permissions on sshd config - Add all required packages for openSUSE to xorg module - Softlink sh to bash in rootfs-stage32, as some scripts might fail otherwise Thanks hwinfo but we don't need you anymore Added size log fix list_packet_files exiting loop when a packet wasnt installed remove flag checks, now done in setup_target check if kernel module is already built-in --- mltk | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) (limited to 'mltk') diff --git a/mltk b/mltk index 49ceee09..8d1bd367 100755 --- a/mltk +++ b/mltk @@ -26,13 +26,21 @@ qnd_exit() { [ $# -ge 1 ] && kill "$1" } -. "${ROOT_DIR}/helper/logging.inc" -. "${ROOT_DIR}/helper/useradd.inc" -. "${ROOT_DIR}/helper/downloader.inc" -. "${ROOT_DIR}/helper/fileutil.inc" -. "${ROOT_DIR}/helper/binutil.inc" -. "${ROOT_DIR}/helper/system.inc" - +for HELPER in $ROOT_DIR/helper/*.inc; do + . "$HELPER" && continue + unset_quiet + echo "Could not source $HELPER" + qnd_exit +done + +# TODO: Configurable! +if [ "$(uname -p)" = "x86_64" ]; then + KERNEL_VERSION="3.4.0-1.16-default+" + SELECTED_KERNEL="x86_64/$KERNEL_VERSION" +else + KERNEL_VERSION="3.4.0-1.16-default" + SELECTED_KERNEL="x86_32/$KERNEL_VERSION" +fi banner () { echo -e "\033[38;5;202m\t __ __ __ " @@ -49,7 +57,7 @@ print_usage() { echo -e "" echo -e "Toolkit for creating preboot mini-linux for OpenSLX NG (mltk)" echo -e "Usage: $(basename ${SELF}) remote [-d] [-c [module]*] [-b [module]*] [-p profile]" - echo -e " $(basename ${SELF}) server [-e stage31|stage32|addons] [-d] [-c]" + echo -e " $(basename ${SELF}) server [-s] [] [-e stage31|stage32|addons] [-d] [-c]" echo -e "" echo -e " Mode:" echo -e " server \t server mode: packs stage3.1, stage3.2 or addons as initramfs/squashfs." @@ -58,9 +66,10 @@ print_usage() { echo -e " Mode options:" echo -e " -b remote: build module(s)" echo -e " -e type server: export target as stage31, stage32 or addons" + echo -e " -s server: sync 'builds' directory of remote host" echo -e " -c remote: clean module(s). / server: clean target in remote_builds/ and corresponding files under boot/" echo -e " -d activates debug output for current target/build" - echo -e " -p profile build all modules from given profile" + echo -e " -p profile remote: build all modules from given profile" echo -e "" echo -e " In mode 'remote', you can pass names of specific modules to clean/build." echo -e " Otherwise, all modules will be built/cleaned." @@ -76,7 +85,7 @@ print_usage() { echo -e " Existing targets for remote are:" echo -e " $(echo $(ls ${ROOT_DIR}/remote/targets 2>/dev/null || echo "No targets for remote found."))" echo -e " Existing targets for server are:" - echo -e " $(echo $(ls ${ROOT_DIR}/server/remote_builds 2>/dev/null || echo "No targets for remote found."))" + echo -e " $(echo $(ls ${ROOT_DIR}/server/remote_builds 2>/dev/null || echo "No targets for server found."))" echo -e "" } @@ -91,7 +100,7 @@ initial_checks() { pinfo "Arch triplet of this machine: $ARCH_TRIPLET" pinfo "Kernel version: $KERNEL_VERSION" pinfo "System's packet manager is $PACKET_MANAGER" - + # setup_target and export_target REMOTE_SETUP_TARGET="${ROOT_DIR}/remote/setup_target" SERVER_EXPORT_TARGET="${ROOT_DIR}/server/export_target" @@ -124,7 +133,7 @@ read_params() { if [[ $1 != "-"* ]]; then TARGET=$1 shift - else + elif [[ $1 != "-s" ]]; then perror "A target is required. None given." fi @@ -136,6 +145,11 @@ read_params() { # options to current target if [[ "$PARAM" == "-"* ]]; then case "$PARAM" in + -s) + SERVER_SYNC="1" + #TODO mit Remote IP + continue + ;; -c) SUBMODE="CLEAN" ;; @@ -183,7 +197,8 @@ read_params() { done # exit if no command - [[ $SERVER_CLEAN == 0 && $SERVER_EXPORT == 0 && $REMOTE_CLEAN == 0 && $REMOTE_BUILD == 0 ]] && print_usage && exit 1 + + [[ $SERVER_CLEAN == 0 && $SERVER_EXPORT == 0 && $REMOTE_CLEAN == 0 && $REMOTE_BUILD == 0 && $SERVER_SYNC == 0 ]] && print_usage && exit 1 } run() { @@ -193,9 +208,10 @@ run() { [[ $REMOTE_CLEAN == 1 ]] && clean_modules $TARGET $REMOTE_LIST_CLEAN [[ $REMOTE_BUILD == 1 ]] && generate_target $TARGET $REMOTE_LIST_BUILD fi - if [[ $SERVER_CLEAN == 1 || $SERVER_EXPORT == 1 ]]; then + if [[ $SERVER_CLEAN == 1 || $SERVER_EXPORT == 1 || $SERVER_SYNC == 1 ]]; then [[ $SERVER_DEBUG == 1 ]] && unset_quiet || set_quiet . "${SERVER_EXPORT_TARGET}" || perror "Cannot source ${SERVER_EXPORT_TARGET}" + [[ $SERVER_SYNC == 1 ]] && sync_remote [[ $SERVER_CLEAN == 1 ]] && clean_target $TARGET [[ $SERVER_EXPORT == 1 ]] && export_target $TARGET $SERVER_EXPORT_TYPE fi @@ -205,6 +221,7 @@ SERVER_DEBUG="0" SERVER_EXPORT="0" SERVER_CLEAN="0" SERVER_EXPORT_TYPE="" +SERVER_SYNC="0" REMOTE_DEBUG="0" REMOTE_CLEAN="0" REMOTE_BUILD="0" @@ -215,3 +232,6 @@ initial_checks read_params $@ run + +unmount_kernel_dir + -- cgit v1.2.3-55-g7522