summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2020-01-16 11:30:34 +0100
committerJonathan Bauer2020-01-16 11:30:34 +0100
commit5f97342120aff51bc043f27562393f71f87b4b9b (patch)
tree26b6e6bad7a4d6fcf9752a6f7b3756b0539b5d21
parent[slx-uuid] check if uuid blacklists exists (diff)
downloadsystemd-init-5f97342120aff51bc043f27562393f71f87b4b9b.tar.gz
systemd-init-5f97342120aff51bc043f27562393f71f87b4b9b.tar.xz
systemd-init-5f97342120aff51bc043f27562393f71f87b4b9b.zip
[dnbd3-rootfs] fallback for missing slxsrv in kcl
-rwxr-xr-xbuilder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh b/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh
index a1f8995c..2b63f917 100755
--- a/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh
+++ b/builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh
@@ -17,6 +17,20 @@ slx_server="$(getarg slxsrv=)"
slx_server_base="$(getarg slxbase=)"
exceptions.activate
+# if no slxsrv was specified, use the server the kernel was
+# downloaded from as fallback. Mostly for legacy PXE boot.
+if [ -z "$slx_server" ]; then
+ slx_server="$(getarg BOOT_IMAGE= | awk -F[/:] '{print $4}')"
+fi
+if [ -z "$slx_server" ]; then
+ # use tftp server from ip parameter
+ slx_server="$(getarg ip= | awk -F: '{print $2}' )"
+fi
+if [ -z "$slx_server" ]; then
+ # we have a problem :/
+ emergency_shell "Failed to determine SLX server to fetch config from."
+fi
+
# build config_url
config_url="http://${slx_server#@}/${slx_server_base}/config"