diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/clone_stage4 | 33 | ||||
| -rw-r--r-- | scripts/clone_stage4.README | 6 |
2 files changed, 14 insertions, 25 deletions
diff --git a/scripts/clone_stage4 b/scripts/clone_stage4 index 9691c609..4c430aa8 100755 --- a/scripts/clone_stage4 +++ b/scripts/clone_stage4 @@ -15,18 +15,15 @@ MLTK_PID="$$" qnd_exit() { unset_quiet kill "$MLTK_PID" - [ $# -ge 1 ] && kill "$1" + [ $# -ge 1 ] && kill "$REMOTE_HOST" } -[ $# -lt 3 ] && perror "$0 <remote_ip> <stage_to_exclude> <target_dir>" -[ "$1" = "local" ] && perror 'It is not wise to use "local" as remote IP.' +[ $# -ne 2 ] && perror "$0 <remote_ip> <target_dir> (-- Hint: <stage_to_exclude> is gone now, only two parameters are needed)" +[ "$REMOTE_HOST" = "local" ] && perror 'It is not wise to use "local" as remote IP.' -BASE_DIR="${ROOT_DIR}/server/local_builds/$1" -BOOT_DIR="${ROOT_DIR}/server/boot/$1" -[ ! -d "$BASE_DIR" ] && perror "Unknown Vorlage '$1'" -BASE_DIR="${BASE_DIR}/$2" -[ ! -d "$BASE_DIR" ] && perror "Unknown Stage '$2' for Vorlage '$1'" -TARGET_DIR="$3" +REMOTE_HOST="$1" +BOOT_DIR="${ROOT_DIR}/server/boot/$REMOTE_HOST" +TARGET_DIR="$2" mkdir -p "$TARGET_DIR" mkdir -p "$BOOT_DIR" @@ -34,8 +31,8 @@ EXCLUDE="$BOOT_DIR/exclude-stage4" INCLUDE="$BOOT_DIR/include-stage4" pinfo "Building rsync exclude-file for building stage 4...." -echo "## Exclude file for stage4 of $1" > "$EXCLUDE" -echo "## Include file for stage4 of $1" > "$INCLUDE" +echo "## Exclude file for stage4 of $REMOTE_HOST" > "$EXCLUDE" +echo "## Include file for stage4 of $REMOTE_HOST" > "$INCLUDE" for FILE in $(find "$ROOT_DIR"/server/blacklists/*/ -type f); do echo "## From $FILE" >> "$EXCLUDE" echo "## From $FILE" >> "$INCLUDE" @@ -43,25 +40,17 @@ for FILE in $(find "$ROOT_DIR"/server/blacklists/*/ -type f); do grep '^+' "$FILE" >> "$INCLUDE" done -echo "## From cloned $2 of $1" >> "$EXCLUDE" -# this next command lists all files found in BASE_DIR and removes the prefix BASE_DIR -IFS=$'\n' -for FILE in $(find "${BASE_DIR}" -type f -or -type l | cut -c $[${#BASE_DIR} + 1]-); do - echo "- $FILE" >> "$EXCLUDE" -done -unset IFS - pinfo "Done." [ "y$UID" == "y0" ] || perror "You're not root. Cannot continue with rsync." # prepare rsync's options depending on whether the source is local or remote RSYNC_OPTS="" RSYNC_SOURCE="" -if [[ "$1" == "local" ]]; then +if [[ "$REMOTE_HOST" == "local" ]]; then RSYNC_SOURCE="/" else - RSYNC_SOURCE="root@$1:/" - RSYNC_OPTS="-e ssh -oStrictHostKeyChecking=no" + RSYNC_SOURCE="root@$REMOTE_HOST:/" + RSYNC_OPTS="-e ssh -c arcfour -oStrictHostKeyChecking=no" fi pinfo "Cloning via rsync" diff --git a/scripts/clone_stage4.README b/scripts/clone_stage4.README index 6a8ddf5c..69de8a63 100644 --- a/scripts/clone_stage4.README +++ b/scripts/clone_stage4.README @@ -1,7 +1,7 @@ Some hints for usage of clone_stage4: Use clone_stage4 not on the build computer but on the computer which -provides httpd and nfsd, or, in other words: On the computer which server +provides httpd and nfsd, or, in other words: On the computer which serves the boot files. That's the reason why clone_stage4 rejects 'local' as IP. To use stage4 a nfs export will be necessary. @@ -25,10 +25,10 @@ Then, on the service computer (the one where's booted from etc, see above) (etc.) Well, then do the cloning work: - ./scripts/clone_stage4 [IP] stage32 /path/to/your/nfs/share/stage4 + ./scripts/clone_stage4 [IP] /path/to/your/nfs/share/stage4 To use the stage4 make sure your (base) config file contains a line - SLX_STAGE4_NFS=[IP of service computer] :/path/to/your/nfs/share/stage4 + SLX_STAGE4_NFS=[IP of service computer]:/path/to/your/nfs/share/stage4 At least now (20130912) it is necessary to enter |
