From a05629b9f4088b0762b4ee4d7396440117115d09 Mon Sep 17 00:00:00 2001 From: Ghe Rivero Date: Wed, 20 Feb 2013 13:07:23 +0100 Subject: [PATCH] Support multiple outputs disk formats Using the IMAGE_TYPE env variable, you can select which ouput disk format you want for your image. Only qcow2 format supports compression. Change-Id: Ia01d9079c354dbd3cfcf870d86f97ee57bd9d479 --- lib/img-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/img-functions b/lib/img-functions index 8a0ad7bb..f0914840 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -166,7 +166,8 @@ function finalise_base () { function compress_image () { # Recreate our image to throw away unnecessary data - qemu-img convert ${COMPRESS_IMAGE:+-c} $TMP_IMAGE_PATH -O qcow2 $TMP_IMAGE_PATH-new + test $IMAGE_TYPE != qcow2 && COMPRESS_IMAGE="" + qemu-img convert ${COMPRESS_IMAGE:+-c} $TMP_IMAGE_PATH -O $IMAGE_TYPE $TMP_IMAGE_PATH-new rm $TMP_IMAGE_PATH mv $TMP_IMAGE_PATH-new $TMP_IMAGE_PATH }