Merge "Combine compress and save image into one function"
This commit is contained in:
commit
316d6beeaf
@ -148,8 +148,7 @@ finalise_base
|
||||
unmount_image
|
||||
|
||||
if [ "$IS_RAMDISK" == "0" ]; then
|
||||
compress_image
|
||||
save_image $IMAGE_NAME.$IMAGE_TYPE
|
||||
compress_and_save_image $IMAGE_NAME.$IMAGE_TYPE
|
||||
else
|
||||
remove_image
|
||||
fi
|
||||
|
@ -106,12 +106,13 @@ function finalise_base () {
|
||||
fi
|
||||
}
|
||||
|
||||
function compress_image () {
|
||||
function compress_and_save_image () {
|
||||
# Recreate our image to throw away unnecessary data
|
||||
test $IMAGE_TYPE != qcow2 && COMPRESS_IMAGE=""
|
||||
qemu-img convert ${COMPRESS_IMAGE:+-c} -f raw $TMP_IMAGE_PATH -O $IMAGE_TYPE $TMP_IMAGE_PATH-new
|
||||
qemu-img convert ${COMPRESS_IMAGE:+-c} -f raw $TMP_IMAGE_PATH -O $IMAGE_TYPE $1-new
|
||||
rm $TMP_IMAGE_PATH
|
||||
mv $TMP_IMAGE_PATH-new $TMP_IMAGE_PATH
|
||||
|
||||
TMP_IMAGE_PATH=$1-new save_image $1
|
||||
}
|
||||
|
||||
function remove_image () {
|
||||
|
Loading…
Reference in New Issue
Block a user