From 3037959b37c6cdfd9a2b43ec9b33e9470c0d8f2e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 20 Jun 2013 17:18:03 +0200 Subject: [rootfs-stage31/32] Try to download slxconfig in stage31 already, retry in stage32 if it failed --- remote/rootfs/rootfs-stage31/data/init | 6 ++++-- .../data/etc/systemd/system/download-config.service | 1 + .../data/opt/openslx/bin/activate-sysconfig | 15 +++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'remote') diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init index bf11d9aa..586b21df 100755 --- a/remote/rootfs/rootfs-stage31/data/init +++ b/remote/rootfs/rootfs-stage31/data/init @@ -106,10 +106,12 @@ mount -n --move /dev/shm/uniontmp /mnt/uniontmp || drop_shell "Problem moving un [ $DEBUG -ge 2 ] && drop_shell "Requested Debug Shell: after aufs'ing." +# Download config if available +/mnt/opt/openslx/bin/activate-sysconfig /mnt + # create udev rule for nic we booted from cat > "/mnt/etc/udev/rules.d/70-net-boot-nic-name.rules" < /dev/null && echo "Config already fetched." && exit 0 URL="$(grep -o -E "slxconfig=\S+" /proc/cmdline | cut -c 11-)" @@ -9,13 +15,14 @@ if [ -z "$URL" ]; then exit 1 fi -wget -q -O "/opt/openslx/config-remote" "$URL" +wget -T 5 -q -O "${CONFIG}-remote" "$URL" RET=$? if [ "x$RET" != "x0" ]; then echo "Error - downloading '$URL' via wget failed. Exit Code: $RET" exit 1 fi -echo "# Config fetched from $URL" >> "/opt/openslx/config" -cat "/opt/openslx/config-remote" >> "/opt/openslx/config" +echo "# Config fetched from $URL" >> "$CONFIG" +echo "#_RCONFIG_TAG" >> "$CONFIG" +cat "${CONFIG}-remote" >> "$CONFIG" exit 0 -- cgit v1.2.3-55-g7522