From 560eb13d6468f142d6aaaae78f85bc22a6acc7cf Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Mon, 10 Sep 2018 09:09:59 +0800 Subject: Fix loop device name In [1], ${loopdevice:0:5} is wrong when loopdevice is loop13p1. [1] https://build.opnfv.org/ci/job/daisy-kolla-build-master/36/console Change-Id: I3bfcf771c8b510f9c5c1f853a1a61a299106d5dc Signed-off-by: Alex Yang --- tools/daisy-img-modify.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/daisy-img-modify.sh b/tools/daisy-img-modify.sh index ff1ff437..6d2ff53f 100755 --- a/tools/daisy-img-modify.sh +++ b/tools/daisy-img-modify.sh @@ -165,8 +165,8 @@ resize() { kpartx -av $raw_imgfile sleep 2 dmsetup ls - fdisk -l /dev/${loopdevice:0:5} || true - growpart /dev/${loopdevice:0:5} 1 + fdisk -l /dev/${loopdevice:0:-2} || true + growpart /dev/${loopdevice:0:-2} 1 dmsetup clear $loopdevice kpartx -dv $raw_imgfile || eliminate } @@ -179,7 +179,7 @@ setup() { kpartx -av $raw_imgfile sleep 2 dmsetup ls - fdisk -l /dev/${loopdevice:0:5} || true + fdisk -l /dev/${loopdevice:0:-2} || true if [ "xfs" = "$(blkid -o value -s TYPE /dev/mapper/$loopdevice)" ]; then mountopts="-o nouuid" -- cgit 1.2.3-korg