summaryrefslogtreecommitdiffstats
path: root/meta/classes/image-vm.bbclass
diff options
context:
space:
mode:
authorChristian Ziethén <christian.ziethen@linaro.org>2015-07-23 16:32:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-25 14:41:43 +0100
commit2963cc25afb65376ba6a1a6487274143bd67f674 (patch)
treeae0ed8860e007ba4eba30826d13a836991130933 /meta/classes/image-vm.bbclass
parent6dcd3555712a1e83b519e7912a5ba35a3971ce4f (diff)
downloadpoky-2963cc25afb65376ba6a1a6487274143bd67f674.tar.gz
image: Support for qcow2
Add support for qcow2 image format. Implemented in the same way as the previously existing vmdk and vdi solutions. (From OE-Core rev: c1f9ed400e4b5fe5be4fac86021dea11a7546035) Signed-off-by: Christian Ziethén <christian.ziethen@linaro.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image-vm.bbclass')
-rw-r--r--meta/classes/image-vm.bbclass12
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
15IMAGE_TYPEDEP_vmdk = "ext3" 15IMAGE_TYPEDEP_vmdk = "ext3"
16IMAGE_TYPEDEP_vdi = "ext3" 16IMAGE_TYPEDEP_vdi = "ext3"
17IMAGE_TYPES_MASKED += "vmdk vdi" 17IMAGE_TYPEDEP_qcow2 = "ext3"
18IMAGE_TYPES_MASKED += "vmdk vdi qcow2"
18 19
19create_vmdk_image () { 20create_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
30create_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
29python do_vmimg() { 35python 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
36addtask vmimg after do_bootdirectdisk before do_build 44addtask vmimg after do_bootdirectdisk before do_build