From 276d52267a39370e18748bd0c199da16cf61c9d3 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 2 Jun 2020 15:01:25 +0200 Subject: [dnbd3-rootfs] use xlosetup to find target dev --- modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh b/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh index a579d49d..479b5c1d 100755 --- a/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh +++ b/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh @@ -34,9 +34,9 @@ container_unpack_xmount() { echo "$out_device" } -container_unpack_losetup() { +container_unpack_xlosetup() { local in_device="$1" - local out_device="$(losetup -f)" + local out_device="$(xlosetup -f)" if ! xlosetup -r -t QCOW "$out_device" "$in_device" --partscan; then warn "Failed to attach '$in_device' to '$out_device'." return @@ -98,7 +98,7 @@ if [ -z "$SLX_QCOW_HANDLER" ]; then echo "SLX_QCOW_HANDLER='$SLX_QCOW_HANDLER'" >> /etc/openslx fi if [ "$SLX_QCOW_HANDLER" = "kernel" ]; then - read_only_device="$(container_unpack_losetup "$_dnbd3_dev")" + read_only_device="$(container_unpack_xlosetup "$_dnbd3_dev")" fi if [ -z "$read_only_device" ] || [ "$SLX_QCOW_HANDLER" = "xmount" ]; then read_only_device="$(container_unpack_xmount "$_dnbd3_dev")" -- cgit v1.2.3-55-g7522