Build: Support VDI, VDHX, VMDK (#259)

* Support VDI, VDHX, VMDK

* Update hassos-hook.sh

* Update hdd-image.sh
This commit is contained in:
Pascal Vizeli 2018-11-26 12:14:44 +01:00 committed by GitHub
parent 4411307353
commit 5ff51846e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -14,7 +14,10 @@ function hassos_pre_image() {
function hassos_post_image() {
convert_disk_image_vmdk
convert_disk_image_virtual
convert_disk_image_gz vmdk
convert_disk_image_gz vhdx
convert_disk_image_gz vdi
}

View File

@ -284,12 +284,20 @@ function _fix_disk_spl_mbr() {
}
function convert_disk_image_vmdk() {
function convert_disk_image_virtual() {
local hdd_img="$(hassos_image_name img)"
local hdd_vmdk="$(hassos_image_name vmdk)"
local hdd_vhdx="$(hassos_image_name vhdx)"
local hdd_vdi="$(hassos_image_name vdi)"
rm -f ${hdd_vmdk}
rm -f ${hdd_vhdx}
rm -f ${hdd_vdi}
qemu-img convert -O vmdk ${hdd_img} ${hdd_vmdk}
qemu-img convert -O vhdx ${hdd_img} ${hdd_vhdx}
qemu-img convert -O vdi ${hdd_img} ${hdd_vdi}
rm -f ${hdd_img}
}