diff options
-rwxr-xr-x | modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh | 23 |
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=", " |