diff options
Diffstat (limited to 'builder/modules.d/dnbd3-rootfs/hooks')
-rwxr-xr-x | builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh b/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh index b0c338d3..23f1185b 100755 --- a/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh +++ b/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh @@ -49,14 +49,28 @@ container_unpack_losetup() { } # endregion -exceptions.try -{ # region connect dnbd3 image -# if not specified, use the default name for the bwlp stage4 image +# Determine stage4 image path and revision +if [ -z "$SLX_DNBD3_IMAGE" ]; then + # specified on the KCL? + SLX_DNBD3_IMAGE="$(getarg slx.stage4.path=)" +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)" - echo "SLX_DNBD3_IMAGE='$SLX_DNBD3_IMAGE'" >> /etc/openslx fi +# save it for later +echo "SLX_DNBD3_IMAGE='$SLX_DNBD3_IMAGE'" >> /etc/openslx +if [ -z "$SLX_DNBD3_RID" ]; then + # specified on the KCL? + SLX_DNBD3_RID="$(getarg slx.stage4.rid=)" +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 +exceptions.try +{ ( IFS=", " for host in ${SLX_DNBD3_SERVERS} FAIL; do @@ -70,7 +84,7 @@ for host in ${SLX_DNBD3_SERVERS} FAIL; do --host "$host" \ --image "${SLX_DNBD3_IMAGE}" \ --device "$_dnbd3_dev" \ - ${SLX_DNBD3_RID:+--rid "$SLX_DNBD3_RID"}; then + "${_dnbd3_client_additional_args[@]}"; then break fi done |