diff options
Diffstat (limited to 'builder/modules.d/dnbd3-rootfs')
-rwxr-xr-x | builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh | 24 | ||||
-rwxr-xr-x | builder/modules.d/dnbd3-rootfs/module-setup.sh | 2 |
2 files changed, 20 insertions, 6 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 diff --git a/builder/modules.d/dnbd3-rootfs/module-setup.sh b/builder/modules.d/dnbd3-rootfs/module-setup.sh index 1dd16cd4..392dee85 100755 --- a/builder/modules.d/dnbd3-rootfs/module-setup.sh +++ b/builder/modules.d/dnbd3-rootfs/module-setup.sh @@ -215,7 +215,7 @@ install() { fi # endregion # region hooks - inst_hook cmdline 00 "$moddir/hooks/enable-sysrq.sh" + #inst_hook cmdline 00 "$moddir/hooks/enable-sysrq.sh" # NOTE: Can be used to support old style ip append syntax and have an # exclusive interface name - required when using dracut's regular # 'network' module |