From ebd54b1010afe1857d8f9917e6bde205846ac070 Mon Sep 17 00:00:00 2001 From: tanlin Date: Wed, 28 May 2014 17:17:50 +0800 Subject: [PATCH] Correct the wrong rename in rhel element There is a substitution of suffix in rhel element, like rhel-guest-image-6.5-20140121.0.x86_64.qcow2 to rhel-guest-image-6.5-20140121.0.x86_64.raw The convert is correct but the substitution of the suffix is wrong. ${PARAMETER#PATTERN} will match the string from the beginning and generate rhel-guest-image-6.5-20140121.0.x86_64.qcow2.raw We should use ${PARAMETER%PATTERN} instead, which is from the end. Change-Id: Ic45a3f800058ea9e5d746ff543c068a54632407d --- elements/rhel/root.d/10-rhel-cloud-image | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/rhel/root.d/10-rhel-cloud-image b/elements/rhel/root.d/10-rhel-cloud-image index aae92d5bb..72732bf74 100755 --- a/elements/rhel/root.d/10-rhel-cloud-image +++ b/elements/rhel/root.d/10-rhel-cloud-image @@ -29,7 +29,7 @@ else EACTION="rm -r $WORKING" trap "$EACTION" EXIT RAW_FILE=$(basename $BASE_IMAGE_FILE) - RAW_FILE=${RAW_FILE#.qcow2}.raw + RAW_FILE=${RAW_FILE%.qcow2}.raw qemu-img convert -f qcow2 -O raw $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE $WORKING/$RAW_FILE MAGIC_BIT=p1 # NOTE: On RHEL, partprobe of /dev/loop0 does not create /dev/loop0p2,