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
| ... | ... |
@@ -283,6 +283,15 @@ function upload_image {
|
| 283 | 283 |
DISK_FORMAT=iso |
| 284 | 284 |
CONTAINER_FORMAT=bare |
| 285 | 285 |
;; |
| 286 |
+ *.vhd|*.vhdx|*.vhd.gz|*.vhdx.gz) |
|
| 287 |
+ local extension="${IMAGE_FNAME#*.}"
|
|
| 288 |
+ IMAGE_NAME=$(basename "$IMAGE" ".$extension") |
|
| 289 |
+ DISK_FORMAT=vhd |
|
| 290 |
+ CONTAINER_FORMAT=bare |
|
| 291 |
+ if [ "${IMAGE_FNAME##*.}" == "gz" ]; then
|
|
| 292 |
+ UNPACK=zcat |
|
| 293 |
+ fi |
|
| 294 |
+ ;; |
|
| 286 | 295 |
*) echo "Do not know what to do with $IMAGE_FNAME"; false;; |
| 287 | 296 |
esac |
| 288 | 297 |
|