summaryrefslogtreecommitdiffstats
path: root/server/export_target
diff options
context:
space:
mode:
authorJonathan Bauer2013-11-27 14:10:45 +0100
committerJonathan Bauer2013-11-27 14:10:45 +0100
commit2e8f0b7b345de4c8a2a978b8b5f340254b3de3a2 (patch)
treeeb0d323da8aa205c0a7ce97d6ddbc08dc9b5f6cc /server/export_target
parent[kdm] kdm wants plymouth to quit before executing (diff)
downloadtm-scripts-2e8f0b7b345de4c8a2a978b8b5f340254b3de3a2.tar.gz
tm-scripts-2e8f0b7b345de4c8a2a978b8b5f340254b3de3a2.tar.xz
tm-scripts-2e8f0b7b345de4c8a2a978b8b5f340254b3de3a2.zip
[export_target] rsync return status handling
Diffstat (limited to 'server/export_target')
-rwxr-xr-xserver/export_target14
1 files changed, 8 insertions, 6 deletions
diff --git a/server/export_target b/server/export_target
index e5fbce12..68d8beb7 100755
--- a/server/export_target
+++ b/server/export_target
@@ -46,11 +46,17 @@ 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 '$REMOTE_IP:export/build' to './server/local_builds'..."
+ pinfo "Synching 'root@$REMOTE_IP:export/build' 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 --delete -v -e "ssh -oStrictHostKeyChecking=no" "root@$REMOTE_IP:/export/build/*" "$SERVER_BUILD_DIR" || perror "rsync from 'root@$REMOTE_IP:/export/build' to '$SERVER_BUILD_DIR' failed."
+ rsync -a --numeric-ids --delete -v -e "ssh -oStrictHostKeyChecking=no" "root@$REMOTE_IP:/export/build/*" "$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"
+ fi
}
generate_stage32() {
@@ -59,10 +65,6 @@ generate_stage32() {
pinfo "Writing '${TARGET}.sqfs' to '${SERVER_BOOT_DIR}/${TARGET}.sqfs'"
mksquashfs "${SERVER_BUILD_DIR}/${TARGET}/" "${SERVER_BOOT_DIR}/${TARGET}.sqfs" -comp xz -b 1M -no-recovery >&6 || perror "mksquashfs failed ($?)."
pinfo "Created '${SERVER_BOOT_DIR}/${TARGET}.sqfs'."
- #pinfo "Wrapping squashFS in initramfs-stage32"
- #generate_initramfs "${SERVER_BOOT_DIR}/stage32_sqfs" "./mnt/${TARGET}.sqfs" "${SERVER_BOOT_DIR}/initramfs-${TARGET}"
- # cleanup
- #[ -d "${SERVER_BOOT_DIR}/stage32_sqfs" ] && rm -rf ${SERVER_BOOT_DIR}/stage32_sqfs
}
generate_stage31() {