summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2020-06-05 17:31:15 +0200
committerJonathan Bauer2020-06-05 17:31:15 +0200
commit9d6852a84c2cd70a499cf43761b06bc6277cfcb1 (patch)
tree976cda304ea3c5dbb1d26fab2fad3f86aef39284
parent[dnbd3-rootfs] rename container_unpack_{xlosetup => xloop} (diff)
downloadsystemd-init-9d6852a84c2cd70a499cf43761b06bc6277cfcb1.tar.gz
systemd-init-9d6852a84c2cd70a499cf43761b06bc6277cfcb1.tar.xz
systemd-init-9d6852a84c2cd70a499cf43761b06bc6277cfcb1.zip
[dnbd3-rootfs] KCL > SLX_DNBD3_IMAGE
-rwxr-xr-xmodules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh23
1 files changed, 12 insertions, 11 deletions
diff --git a/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh b/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh
index 0e86cce0..a56e5c10 100755
--- a/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh
+++ b/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh
@@ -47,24 +47,25 @@ container_unpack_xloop() {
# endregion
# region connect dnbd3 image
-# Determine stage4 image path and revision
-if [ -z "$SLX_DNBD3_IMAGE" ]; then
- # specified on the KCL?
- SLX_DNBD3_IMAGE="$(getarg slx.stage4.path=)"
+# Determine path to dnbd3 image: either on the kcl or via config file
+declare -r KCL_DNBD3_IMAGE="$(getarg slx.stage4.path=)"
+if [ -n "$KCL_DNBD3_IMAGE" ]; then
+ SLX_DNBD3_IMAGE="$KCL_DNBD3_IMAGE"
+ echo "SLX_DNBD3_IMAGE='$SLX_DNBD3_IMAGE'" >> /etc/openslx
fi
if [ -z "$SLX_DNBD3_IMAGE" ]; then
- # not specified, fall back to old bwlp default path convention
- SLX_DNBD3_IMAGE="stage4/bwlp/maxilinux-$(uname -r)"
+ emergency_shell "Failed to determine which DNBD3 image to use." \
+ "It was neither specified on kernel command line nor in the" \
+ "configuration file."
fi
-# save it for later
-echo "SLX_DNBD3_IMAGE='$SLX_DNBD3_IMAGE'" >> /etc/openslx
-if [ -z "$SLX_DNBD3_RID" ]; then
+declare -r KCL_DNBD3_RID="$(getarg slx.stage4.rid=)"
+if [ -n "$KCL_DNBD3_RID" ]; then
# specified on the KCL?
- SLX_DNBD3_RID="$(getarg slx.stage4.rid=)"
+ SLX_DNBD3_RID="$KCL_DNBD3_RID"
+ echo "SLX_DNBD3_RID='$SLX_DNBD3_RID'" >> /etc/openslx
fi
if [ -n "$SLX_DNBD3_RID" ]; then
_dnbd3_client_additional_args=("--rid" "$SLX_DNBD3_RID")
- echo "SLX_DNBD3_RID='$SLX_DNBD3_RID'" >> /etc/openslx
fi
IFS=", "