summaryrefslogtreecommitdiffstats
path: root/builder/dnbd3-rootfs/hooks
diff options
context:
space:
mode:
authorjandob2016-01-28 12:35:01 +0100
committerjandob2016-01-28 12:35:01 +0100
commitab65304f7e4a4e39fed6c79c1dd1bc5d3029529a (patch)
treec2f44909d788a339cca0d19bfe1c8ccba841216c /builder/dnbd3-rootfs/hooks
parentautomatic xmount building (diff)
downloadsystemd-init-ab65304f7e4a4e39fed6c79c1dd1bc5d3029529a.tar.gz
systemd-init-ab65304f7e4a4e39fed6c79c1dd1bc5d3029529a.tar.xz
systemd-init-ab65304f7e4a4e39fed6c79c1dd1bc5d3029529a.zip
fix
Diffstat (limited to 'builder/dnbd3-rootfs/hooks')
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/prepare-root-partition.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh b/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh
index a9407287..c05ebffb 100755
--- a/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh
+++ b/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh
@@ -38,18 +38,18 @@ fi
# endregion
# region scan partitions
read_only_device=""
-if ! qemu-img info --output json "$SLX_DNBD3_DEVICE" | grep '"format": "raw"'
+if qemu-img info --output json "$SLX_DNBD3_DEVICE" | grep '"format": "raw"'
then
- read_only_device="$(container-unpack-xmount $SLX_DNBD3_DEVICE)"
-else
# workaround to detect partitions on raw disks
# can be omited when the dnbd3 kernel module supports it (like the nbd
# kernel module with parameter 'max_part')
loop_device="$(losetup -f)"
+ losetup "$loop_device" "$SLX_DNBD3_DEVICE" --partscan
+ read_only_device="$loop_device"
touch $read_only_device
- losetup "$loop_device" "$read_only_device" --partscan
udevadm settle
- read_only_device="$loop_device"
+else
+ read_only_device="$(container-unpack-xmount $SLX_DNBD3_DEVICE)"
fi
# endregion