Signed-off-by: Karel Zak <kzak@redhat.com>
function ts_device_init {
local IMAGE="$TS_OUTDIR/$TS_NAME.img"
- local IMAGE_RE=$( echo "$IMAGE" | sed 's:/:\\/:g' )
local DEV=""
ts_backup_cache
dd if=/dev/zero of="$IMAGE" bs=1M count=5 &> /dev/null
- $TS_CMD_LOSETUP -f "$IMAGE" 2>&1 >> $TS_OUTPUT
- DEV=$( $TS_CMD_LOSETUP -a | $AWK 'BEGIN {FS=":"} /'$IMAGE_RE'/ { print $1 }' )
+ DEV=$($TS_CMD_LOSETUP -s -f "$IMAGE")
if [ -z "$DEV" ]; then
ts_device_deinit $DEV
IMAGE="$TS_OUTDIR/cramfs-loop.img"
IMAGE_DATA="$TS_OUTDIR/cramfs-data"
-IMAGE_RE=$( echo $IMAGE | sed 's:/:\\/:g' )
LABEL="testCramfs"
TS_MOUNTPOINT="$TS_OUTDIR/cramfs-mnt"
ts_log "create loop device from image"
ts_backup_cache
-DEVICE=$( $TS_CMD_LOSETUP -f )
-$TS_CMD_LOSETUP $DEVICE $IMAGE 2>&1 >> $TS_OUTPUT
+DEVICE=$( $TS_CMD_LOSETUP -s -f $IMAGE)
ts_log "check the image"
ts_device_has "TYPE" "cramfs" $DEVICE