mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 14:11:07 +02:00
vm_image_util: add IMAGE_DISK_EXTENSION variable
This variable allows to override the disk extension which is initially based on the DISK_FORMAT. Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
This commit is contained in:
parent
038ec80ec0
commit
5c2a8cf8b9
@ -110,6 +110,9 @@ IMG_DEFAULT_FS_HOOK=
|
||||
# May be raw, qcow2 (qemu), or vmdk (vmware, virtualbox)
|
||||
IMG_DEFAULT_DISK_FORMAT=raw
|
||||
|
||||
# Extension to set before the compression extension.
|
||||
IMG_DEFAULT_DISK_EXTENSION=
|
||||
|
||||
# Name of the partition layout from disk_layout.json
|
||||
IMG_DEFAULT_DISK_LAYOUT=base
|
||||
|
||||
@ -421,6 +424,11 @@ _dst_path() {
|
||||
# Get the proper disk format extension.
|
||||
_disk_ext() {
|
||||
local disk_format=$(_get_vm_opt DISK_FORMAT)
|
||||
local disk_extension=$(_get_vm_opt DISK_EXTENSION)
|
||||
if [[ -n ${disk_extension} ]]; then
|
||||
echo "${disk_extension}"
|
||||
return 0
|
||||
fi
|
||||
case ${disk_format} in
|
||||
raw) echo bin;;
|
||||
qcow2) echo img;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user