diff options
| author | Dirk | 2014-02-21 11:16:02 +0100 |
|---|---|---|
| committer | Dirk | 2014-02-21 11:16:02 +0100 |
| commit | 1e30627c5b00884054fae7210d036e34ebe4f181 (patch) | |
| tree | 6d258c5a7a2279881706f38e37921dc4557a0b8d /server/export_target | |
| parent | Setzen des Windows-Namens beim Booten aus Laufwerk B: (diff) | |
| parent | [nvidia_libs] Debug: Checkin für Joey:). (diff) | |
| download | tm-scripts-1e30627c5b00884054fae7210d036e34ebe4f181.tar.gz tm-scripts-1e30627c5b00884054fae7210d036e34ebe4f181.tar.xz tm-scripts-1e30627c5b00884054fae7210d036e34ebe4f181.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
...
Diffstat (limited to 'server/export_target')
| -rwxr-xr-x | server/export_target | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/server/export_target b/server/export_target index 9e346708..d930b8ee 100755 --- a/server/export_target +++ b/server/export_target @@ -25,6 +25,9 @@ SERVER_BUILD_DIR="${MODE_DIR}/local_builds/${REMOTE_IP}" # target directory SERVER_CONFIGS_DIR="${MODE_DIR}/configs" +# allow to specify a different remote export dir via ENV +[ -z $REMOTE_EXPORT_DIR ] && REMOTE_EXPORT_DIR="/export/build" + # initial checks initial_checks() { @@ -46,16 +49,16 @@ copy_kernel() { sync_remote() { [[ "${#SERVER_BUILD_DIR}" -lt "10" ]] && perror "Safety check failed: SERVER_BUILD_DIR is less than 10 chars. ($SERVER_BUILD_DIR)" - pinfo "Synching 'root@$REMOTE_IP:export/build' to '$SERVER_BUILD_DIR'. This might take a while..." + pinfo "Synching 'root@$REMOTE_IP:$REMOTE_EXPORT_DIR' to '$SERVER_BUILD_DIR'. This might take a while..." #TODO setup link to remote build directory, later this directory will be rsynced or exported to this server... mkdir -p "${SERVER_BUILD_DIR}" || perror "Could not create directory for local copy of remote system ($SERVER_BUILD_DIR)" - rsync -a --numeric-ids --exclude '**/.mltk' --delete --delete-excluded -v -e "ssh -c arcfour -oStrictHostKeyChecking=no" "root@$REMOTE_IP:/export/build/*" "$SERVER_BUILD_DIR" + rsync -a --numeric-ids --exclude '**/.mltk' --delete --delete-excluded -v -e "ssh -c arcfour -oStrictHostKeyChecking=no" "root@$REMOTE_IP:$REMOTE_EXPORT_DIR/*" "$SERVER_BUILD_DIR" local RET=$? if [ $RET -eq 0 ]; then pinfo "Syncing completed." else - perror "Syncing of 'root@$REMOTE_IP:/export/build' to '$SERVER_BUILD_DIR' failed with error code: $RET. (Is '/export/build' available on target machine?)" + perror "Syncing of 'root@$REMOTE_IP:$REMOTE_EXPORT_DIR' to '$SERVER_BUILD_DIR' failed with error code: $RET. (Is '$REMOTE_EXPORT_DIR' available on target machine? If not run './mltk -n' on remote machine to export the build directory.)" fi } @@ -137,20 +140,24 @@ export_target() { initial_checks copy_kernel - TARGET=$1 + local TARGET="$1" [ -z "$TARGET" ] && perror "No target passed to export_target()" [ -d "${SERVER_BUILD_DIR}/${TARGET}" ] || perror "Given target directory does not exist: ${SERVER_BUILD_DIR}/${TARGET}" + if [ -n "$3" ]; then + local IGNORE="${SERVER_BUILD_DIR}/$3" + [ -d "${IGNORE}" ] || perror "Given 'ignore target' does not exist: ${IGNORE}" + fi case "$2" in cpio) local TOOL_STR="${TOOL_STR} generate_initramfs:" pinfo "Writing 'initramfs-${TARGET}' to '${SERVER_BOOT_DIR}/'" - generate_initramfs "${SERVER_BUILD_DIR}/${TARGET}/" "." "${SERVER_BOOT_DIR}/initramfs-${TARGET}" + generate_initramfs "${SERVER_BUILD_DIR}/${TARGET}/" "." "${SERVER_BOOT_DIR}/initramfs-${TARGET}" "$IGNORE" ;; sqfs) local TOOL_STR="${TOOL_STR} generate_squashfs:" pinfo "Creating '${TARGET}.sqfs' in '${SERVER_BOOT_DIR}/'" - generate_squashfs "${SERVER_BUILD_DIR}/${TARGET}/" "${SERVER_BOOT_DIR}/${TARGET}.sqfs" + generate_squashfs "${SERVER_BUILD_DIR}/${TARGET}/" "${SERVER_BOOT_DIR}/${TARGET}.sqfs" "$IGNORE" ;; *) perror "Invalid export format: $2" |
