From 5030004309ef0c01f911338dc1f2a08cf5f52cde Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 31 Jan 2014 00:03:50 +0100 Subject: [clone_stage4] Throw error if wrong number of arguments is given, instead of trying broken backwards compatibility mode --- scripts/clone_stage4 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/clone_stage4 b/scripts/clone_stage4 index 8804a57a..4c430aa8 100755 --- a/scripts/clone_stage4 +++ b/scripts/clone_stage4 @@ -15,14 +15,14 @@ MLTK_PID="$$" qnd_exit() { unset_quiet kill "$MLTK_PID" - [ $# -ge 1 ] && kill "$1" + [ $# -ge 1 ] && kill "$REMOTE_HOST" } -[ $# -lt 2 ] && perror "$0 " -[ "$1" = "local" ] && perror 'It is not wise to use "local" as remote IP.' +[ $# -ne 2 ] && perror "$0 (-- Hint: is gone now, only two parameters are needed)" +[ "$REMOTE_HOST" = "local" ] && perror 'It is not wise to use "local" as remote IP.' -BOOT_DIR="${ROOT_DIR}/server/boot/$1" -[ $# -eq 3 ] && shift # compat with old calling convention "$0 " +REMOTE_HOST="$1" +BOOT_DIR="${ROOT_DIR}/server/boot/$REMOTE_HOST" TARGET_DIR="$2" mkdir -p "$TARGET_DIR" mkdir -p "$BOOT_DIR" @@ -31,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" @@ -46,11 +46,11 @@ pinfo "Done." # 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" -- cgit v1.2.3-55-g7522 From 516d0de0a60364f26ab90ee578f24c526b6250c2 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 31 Jan 2014 00:14:30 +0100 Subject: More things to ignore when cloning stage 4 --- server/blacklists/essential/linux-base | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/server/blacklists/essential/linux-base b/server/blacklists/essential/linux-base index 85392873..a7723654 100644 --- a/server/blacklists/essential/linux-base +++ b/server/blacklists/essential/linux-base @@ -40,9 +40,31 @@ - /bin/sh # This is where the bind-mount of mltk resides... - /export/ +# Stuff from /etc we should include in stage 3.2 - /etc/group- - /etc/gshadow - /etc/gshadow- - /etc/passwd- - /etc/shadow- +- /etc/environment +- /etc/fstab +- /etc/group +- /etc/hostname +- /etc/hosts +- /etc/inputrc +- /etc/issue.net +- /etc/localtime +- /etc/login.defs +- /etc/netconfig +- /etc/networks +- /etc/nscd.conf +- /etc/nsswitch.conf +- /etc/pam.conf +- /etc/passwd +- /etc/profile +- /etc/protocols +- /etc/rsyslog.conf +- /etc/securetty +- /etc/services +- /etc/shadow -- cgit v1.2.3-55-g7522