summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2021-10-20 15:44:25 +0200
committerSimon Rettberg2021-10-20 15:44:25 +0200
commit1c6b16454904cfd7ed2a64524f3f86a8562b677b (patch)
treec4c77e8bf7397f18c6a71a7fe516514a4c51c804
parentSimplify cmdline parsing, check qcow handler, don't build unused one (diff)
downloadsystemd-init-1c6b16454904cfd7ed2a64524f3f86a8562b677b.tar.gz
systemd-init-1c6b16454904cfd7ed2a64524f3f86a8562b677b.tar.xz
systemd-init-1c6b16454904cfd7ed2a64524f3f86a8562b677b.zip
[dnbd3-rootfs] Accept kernel and xloop, default to xloop
-rwxr-xr-xmodules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh b/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh
index f61bd7fe..e32595dc 100755
--- a/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh
+++ b/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh
@@ -90,18 +90,18 @@ done
# endregion
# region unpack dnbd3 image
-if ! [[ $SLX_QCOW_HANDLER =~ ^(kernel|xmount)?$ ]]; then
- emergency_shell "Unsupported QCOW handler: $SLX_QCOW_HANDLER" \
- "Use either 'xmount' or 'kernel'."
+if ! [[ $SLX_QCOW_HANDLER =~ ^(kernel|xloop|xmount)?$ ]]; then
+ emergency_shell "Unsupported QCOW handler: $SLX_QCOW_HANDLER" \
+ "Use either 'xmount' or 'xloop'."
fi
if [ -z "$SLX_QCOW_HANDLER" ]; then
- SLX_QCOW_HANDLER="xmount"
- echo "SLX_QCOW_HANDLER='$SLX_QCOW_HANDLER'" >> /etc/openslx
+ SLX_QCOW_HANDLER="xloop"
+ echo "SLX_QCOW_HANDLER='$SLX_QCOW_HANDLER'" >> /etc/openslx
fi
-if [ "$SLX_QCOW_HANDLER" = "kernel" ]; then
+if [[ $SLX_QCOW_HANDLER =~ ^kernel|xloop$ ]]; then
read_only_device="$(container_unpack_xloop "$_dnbd3_dev")"
fi
-if [ -z "$read_only_device" ] || [ "$SLX_QCOW_HANDLER" = "xmount" ]; then
+if [ -z "$read_only_device" ]; then
read_only_device="$(container_unpack_xmount "$_dnbd3_dev")"
fi