summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2020-01-28 12:52:41 +0100
committerJonathan Bauer2020-01-28 12:52:41 +0100
commit87f17861eaaab7f57d9beb6e3546b8bf08492f6b (patch)
tree25256604c26014a01d4a0ec509fbbf11a149a032
parentbuild-initramfs.sh: remove '--no-tags' from git clone routine since it does n... (diff)
downloadsystemd-init-87f17861eaaab7f57d9beb6e3546b8bf08492f6b.tar.gz
systemd-init-87f17861eaaab7f57d9beb6e3546b8bf08492f6b.tar.xz
systemd-init-87f17861eaaab7f57d9beb6e3546b8bf08492f6b.zip
[dnbd3-rootfs] support dnbd3 image & rid from kcl
-rwxr-xr-xbuilder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh24
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