diff options
author | Jonathan Bauer | 2020-01-16 11:30:34 +0100 |
---|---|---|
committer | Jonathan Bauer | 2020-01-16 11:30:34 +0100 |
commit | 5f97342120aff51bc043f27562393f71f87b4b9b (patch) | |
tree | 26b6e6bad7a4d6fcf9752a6f7b3756b0539b5d21 | |
parent | [slx-uuid] check if uuid blacklists exists (diff) | |
download | systemd-init-5f97342120aff51bc043f27562393f71f87b4b9b.tar.gz systemd-init-5f97342120aff51bc043f27562393f71f87b4b9b.tar.xz systemd-init-5f97342120aff51bc043f27562393f71f87b4b9b.zip |
[dnbd3-rootfs] fallback for missing slxsrv in kcl
-rwxr-xr-x | builder/modules.d/dnbd3-rootfs/hooks/fetch-config.sh | 14 |
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" |