summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorJonathan Bauer2013-08-19 16:49:55 +0200
committerJonathan Bauer2013-08-19 16:49:55 +0200
commit3a535ef15a6386c3070c52e702a1e8503a47deff (patch)
tree351b6ea1558bbfeb4fdd49e767ffffcd046e3c9a /remote
parent[rootfs-stage31] prioritize servers from the config file over those in kernel... (diff)
downloadtm-scripts-3a535ef15a6386c3070c52e702a1e8503a47deff.tar.gz
tm-scripts-3a535ef15a6386c3070c52e702a1e8503a47deff.tar.xz
tm-scripts-3a535ef15a6386c3070c52e702a1e8503a47deff.zip
[rootfs-stage31] renamed a few variables. For the servers to download config stuff from, use SLX_CONFIG_SERVER in your config file
Diffstat (limited to 'remote')
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/bin/activate_sysconfig11
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/bin/setup_stage324
-rw-r--r--remote/rootfs/rootfs-stage31/data/etc/functions6
3 files changed, 13 insertions, 8 deletions
diff --git a/remote/rootfs/rootfs-stage31/data/bin/activate_sysconfig b/remote/rootfs/rootfs-stage31/data/bin/activate_sysconfig
index 9c21565a..1c942d7a 100755
--- a/remote/rootfs/rootfs-stage31/data/bin/activate_sysconfig
+++ b/remote/rootfs/rootfs-stage31/data/bin/activate_sysconfig
@@ -9,7 +9,8 @@ echo "Configuring stage 3.2 ..."
CONFIG="${FUTURE_ROOT}/opt/openslx/config"
# parse kernel command line to determine the base for the URLs
-SLX_BASE=$(read_from_cmdline "slxbase")
+SLX_KCL_SERVERS=$(read_from_cmdline "slxsrv")
+SLX_BASE_PATH=$(read_from_cmdline "slxbase")
#########################################################################
#
@@ -19,7 +20,7 @@ fetch_sysconfig() {
[ -e "$CONFIG" ] && grep '^#_RCONFIG_TAG$' "$CONFIG" > /dev/null \
&& echo "Config already fetched." && return 0
- download "${SLX_BASE}/config" "${CONFIG}-remote" || return 1
+ download "${SLX_BASE_PATH}/config" "${CONFIG}-remote" || return 1
echo "# Config fetched from $URL" >> "$CONFIG"
echo "#_RCONFIG_TAG" >> "$CONFIG"
@@ -32,7 +33,7 @@ fetch_sysconfig() {
fetch_config_files() {
[ -e "${CONFIG}.tgz" ] && echo "config.tgz already downloaded." && exit 0
- download "${SLX_BASE}/config.tgz" "${CONFIG}.tgz" || return 1
+ download "${SLX_BASE_PATH}/config.tgz" "${CONFIG}.tgz" || return 1
}
@@ -45,7 +46,7 @@ update_sysconfig() {
[ ! -e "${CONFIG}" ] && { echo "Cannot update. '$CONFIG' does not exist."; return 1; }
[ ! -e "${CONFIG}.tgz" ] && { echo "Cannot update. '$CONFIG' does not exist."; return 1; }
- # write IP configuration to $CONFIG
+ # write IP and SLX_SERVER configuration to $CONFIG
cat >> "$CONFIG" <<HEREEND
# IP Config written in stage31
SLX_PXE_CLIENT_IP='$CLIENTIP'
@@ -53,6 +54,8 @@ SLX_PXE_SERVER_IP='$SERVERIP'
SLX_PXE_GATEWAY='$GATEWAY'
SLX_PXE_DNS='$DNS_SERVER'
SLX_PXE_MAC='$BRIDGEMAC'
+
+SLX_KCL_SERVERS='$SLX_KCL_SERVERS'
HEREEND
# setup hardware clock
diff --git a/remote/rootfs/rootfs-stage31/data/bin/setup_stage32 b/remote/rootfs/rootfs-stage31/data/bin/setup_stage32
index b6ef2bab..151617bc 100755
--- a/remote/rootfs/rootfs-stage31/data/bin/setup_stage32
+++ b/remote/rootfs/rootfs-stage31/data/bin/setup_stage32
@@ -29,12 +29,12 @@ echo "Setting up stage 3.2 ..."
. /etc/functions
# parse kernel command line to determine the URL of the stage3.2
-SLX_BASE="$(read_from_cmdline "slxbase")"
+SLX_BASE_PATH="$(read_from_cmdline "slxbase")"
STAGE32_TARGET_PATH="/stage32.sqfs"
STAGE32_MOUNT_POINT="/rorootfs"
# try to download it
-download "${SLX_BASE}/stage32.sqfs" "$STAGE32_TARGET_PATH" || return 1
+download "${SLX_BASE_PATH}/stage32.sqfs" "$STAGE32_TARGET_PATH" || return 1
# try to mount it at STAGE32_MOUNT_POINT
echo "Mounting stage 3.2 as SquashFS..."
diff --git a/remote/rootfs/rootfs-stage31/data/etc/functions b/remote/rootfs/rootfs-stage31/data/etc/functions
index 1918c82a..b67da36a 100644
--- a/remote/rootfs/rootfs-stage31/data/etc/functions
+++ b/remote/rootfs/rootfs-stage31/data/etc/functions
@@ -57,14 +57,16 @@ download() {
if [ -e ${FUTURE_ROOT}/opt/openslx/config ]; then
. ${FUTURE_ROOT}/opt/openslx/config || echo "Error - could not source '${FUTURE_ROOT}/opt/openslx/config'"
+ else
+ # read SLX_KCL_SERVERS from cmdline since we didn't get it from the config file.
+ local SLX_KCL_SERVERS="$(read_from_cmdline "slxsrv" | tr ',' ' ')"
fi
- local SLX_BASE_SERVERS="$(read_from_cmdline "slxsrv" | tr ',' ' ')"
local FILE_URL="$1"
local TARGET_PATH="$2"
for TIMEOUT in 1 2 3 4 5; do
- for SERVER in $SLX_SERVERS $SLX_BASE_SERVERS; do
+ for SERVER in $SLX_CONFIG_SERVERS $SLX_KCL_SERVERS; do
wget -T 5 -q -O "$TARGET_PATH" "http://${SERVER}/${FILE_URL}"
RET=$?
if [ "x$RET" != "x0" ]; then