This add "losetup" before "kpartx -l" command, otherwise, we encountered
many "Buffer I/O error on dev loop0p1, logical block
104854018,
async page read" in dmesg. But they are seems no harm.
No need to do "losetup -d" after "losetup", because "kpartx -dv"
will do that for us.
Change-Id: I326ef35a241d8b09f0f3f3fc90ef749df3f4768f
Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
# resize the image
qemu-img resize $raw_imgfile ${img_size}G
qemu-img info $raw_imgfile
+ losetup --find --show $raw_imgfile
loopdevice=$(kpartx -l $raw_imgfile | head -1 | cut -f1 -d ' ')
kpartx -av $raw_imgfile
sleep 2
# mount image
setup() {
mkdir -p $mountdir
-
+ losetup --find --show $raw_imgfile
loopdevice=$(kpartx -l $raw_imgfile | head -1 | cut -f1 -d ' ')
-
kpartx -av $raw_imgfile
sleep 2
dmsetup ls