Adds support for Hyper-V image formats

Adds support for VHD and VHDX image formats, including gz compression.

Note: variables naming case changed to match the target branch

(cherry picked from ca8239449f)

Change-Id: I9b143c9883b947397b435a671f13703f78019d23
Closes-bug: #1353726
This commit is contained in:
Alessandro Pilotti 2014-08-07 01:58:02 +03:00
parent 630be3b88b
commit e6721122d5
1 changed files with 9 additions and 0 deletions

View File

@ -1487,6 +1487,15 @@ function upload_image() {
DISK_FORMAT=iso
CONTAINER_FORMAT=bare
;;
*.vhd|*.vhdx|*.vhd.gz|*.vhdx.gz)
local extension="${IMAGE_FNAME#*.}"
IMAGE_NAME=$(basename "$IMAGE" ".$extension")
DISK_FORMAT=vhd
CONTAINER_FORMAT=bare
if [ "${IMAGE_FNAME##*.}" == "gz" ]; then
UNPACK=zcat
fi
;;
*) echo "Do not know what to do with $IMAGE_FNAME"; false;;
esac