From 9d6852a84c2cd70a499cf43761b06bc6277cfcb1 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 5 Jun 2020 17:31:15 +0200 Subject: [dnbd3-rootfs] KCL > SLX_DNBD3_IMAGE --- .../dnbd3-rootfs/hooks/prepare-root-partition.sh | 23 +++++++++++----------- 1 file 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=", " -- cgit v1.2.3-55-g7522