Browse code

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 ca8239449fbdbc3a73f691683be2ec9d4a941ff6)

Change-Id: I9b143c9883b947397b435a671f13703f78019d23
Closes-bug: #1353726

Alessandro Pilotti authored on 2014/08/07 07:58:02
Showing 1 changed files
... ...
@@ -1487,6 +1487,15 @@ function upload_image() {
1487 1487
             DISK_FORMAT=iso
1488 1488
             CONTAINER_FORMAT=bare
1489 1489
             ;;
1490
+        *.vhd|*.vhdx|*.vhd.gz|*.vhdx.gz)
1491
+            local extension="${IMAGE_FNAME#*.}"
1492
+            IMAGE_NAME=$(basename "$IMAGE" ".$extension")
1493
+            DISK_FORMAT=vhd
1494
+            CONTAINER_FORMAT=bare
1495
+            if [ "${IMAGE_FNAME##*.}" == "gz" ]; then
1496
+                UNPACK=zcat
1497
+            fi
1498
+            ;;
1490 1499
         *) echo "Do not know what to do with $IMAGE_FNAME"; false;;
1491 1500
     esac
1492 1501