diff options
Diffstat (limited to 'meta/classes/image-vm.bbclass')
-rw-r--r-- | meta/classes/image-vm.bbclass | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/classes/image-vm.bbclass b/meta/classes/image-vm.bbclass index fdfd14f780..28519c8af1 100644 --- a/meta/classes/image-vm.bbclass +++ b/meta/classes/image-vm.bbclass | |||
@@ -14,7 +14,8 @@ inherit boot-directdisk | |||
14 | 14 | ||
15 | IMAGE_TYPEDEP_vmdk = "ext3" | 15 | IMAGE_TYPEDEP_vmdk = "ext3" |
16 | IMAGE_TYPEDEP_vdi = "ext3" | 16 | IMAGE_TYPEDEP_vdi = "ext3" |
17 | IMAGE_TYPES_MASKED += "vmdk vdi" | 17 | IMAGE_TYPEDEP_qcow2 = "ext3" |
18 | IMAGE_TYPES_MASKED += "vmdk vdi qcow2" | ||
18 | 19 | ||
19 | create_vmdk_image () { | 20 | create_vmdk_image () { |
20 | qemu-img convert -O vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk | 21 | qemu-img convert -O vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk |
@@ -26,11 +27,18 @@ create_vdi_image () { | |||
26 | ln -sf ${IMAGE_NAME}.vdi ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.vdi | 27 | ln -sf ${IMAGE_NAME}.vdi ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.vdi |
27 | } | 28 | } |
28 | 29 | ||
30 | create_qcow2_image () { | ||
31 | qemu-img convert -O qcow2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.qcow2 | ||
32 | ln -sf ${IMAGE_NAME}.qcow2 ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.qcow2 | ||
33 | } | ||
34 | |||
29 | python do_vmimg() { | 35 | python do_vmimg() { |
30 | if 'vmdk' in d.getVar('IMAGE_FSTYPES', True): | 36 | if 'vmdk' in d.getVar('IMAGE_FSTYPES', True): |
31 | bb.build.exec_func('create_vmdk_image', d) | 37 | bb.build.exec_func('create_vmdk_image', d) |
32 | if 'vdi' in d.getVar('IMAGE_FSTYPES', True): | 38 | if 'vdi' in d.getVar('IMAGE_FSTYPES', True): |
33 | bb.build.exec_func('create_vdi_image', d) | 39 | bb.build.exec_func('create_vdi_image', d) |
40 | if 'qcow2' in d.getVar('IMAGE_FSTYPES', True): | ||
41 | bb.build.exec_func('create_qcow2_image', d) | ||
34 | } | 42 | } |
35 | 43 | ||
36 | addtask vmimg after do_bootdirectdisk before do_build | 44 | addtask vmimg after do_bootdirectdisk before do_build |