rm -f "$IMAGE" &> /dev/null
fi
}
+
+function ts_udev_loop_support {
+ ldd $TS_CMD_MOUNT | grep -q 'libvolume_id' 2>&1 >> $TS_OUTPUT
+ if [ "$?" == "0" ]; then
+ HAS_VOLUMEID="yes"
+ fi
+ if [ -n "$HAS_VOLUMEID" ] && [ ! -L "/dev/disk/by-label/$1" ]; then
+ return 1
+ fi
+ return 0
+}
+
LABEL="testCramfs"
MOUNTPOINT="$TS_OUTDIR/cramfs-mnt"
-ldd $TS_CMD_MOUNT | grep -q 'libvolume_id' 2>&1 >> $TS_OUTPUT
-if [ "$?" == "0" ]; then
- HAS_VOLUMEID="yes"
-fi
-
echo "create mountpoint dir" >> $TS_OUTPUT
if [ ! -d "$MOUNTPOINT" ]; then
mkdir -p $MOUNTPOINT
ts_finalize
fi
-if [ -n "$HAS_VOLUMEID" ] && [ ! -L "/dev/disk/by-label/$LABEL" ]; then
- $TS_CMD_LOSETUP -d $DEVICE 2>&1 >> $TS_OUTPUT
+ts_udev_loop_support $LABEL
+if [ "$?" != "0" ]; then
+ ts_device_deinit;
ts_skip "udev ignores /dev/loop*"
fi
LABEL="testSwap"
-ldd $TS_CMD_SWAPON | grep -q 'libvolume_id' 2>&1 >> $TS_OUTPUT
-if [ "$?" == "0" ]; then
- HAS_VOLUMEID="yes"
-fi
-
ts_device_init || ts_finalize
$TS_CMD_MKSWAP -L $LABEL $DEVICE 2>&1 >> $TS_OUTPUT
ts_finalize
fi
-if [ -n "$HAS_VOLUMEID" ] && [ ! -L "/dev/disk/by-label/$LABEL" ]; then
- ts_device_deinit
+ts_udev_loop_support $LABEL
+if [ "$?" != "0" ]; then
+ ts_device_deinit;
ts_skip "udev ignores /dev/loop*"
fi