summaryrefslogtreecommitdiffstats
path: root/meta/classes/image-vm.bbclass
diff options
context:
space:
mode:
authorJuro Bystricky <juro.bystricky@intel.com>2015-06-03 11:07:23 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-11 23:59:13 +0100
commita13c51e751ee76c990fe83f83544e448c6cf543d (patch)
tree0612be3f76df8f4fe2cc2e5ff48bec176bc05469 /meta/classes/image-vm.bbclass
parentd59d876f447c961149763e585c012ac2f0f7b788 (diff)
downloadpoky-a13c51e751ee76c990fe83f83544e448c6cf543d.tar.gz
image: Support for VDI
Added support for VirtualBox VDI format. The support was implemented by merging with the already existing VMDK support for VM player by creating a new class image-vm.bbclass. This class replaces the previous VMDK only image-vmdk.class. (From OE-Core rev: 0a3e8eb9f592c3f1edd2c7521855f7406541651a) Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> 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.bbclass38
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/classes/image-vm.bbclass b/meta/classes/image-vm.bbclass
new file mode 100644
index 0000000000..fdfd14f780
--- /dev/null
+++ b/meta/classes/image-vm.bbclass
@@ -0,0 +1,38 @@
1
2SYSLINUX_ROOT ?= "root=/dev/sda2"
3SYSLINUX_PROMPT ?= "0"
4SYSLINUX_TIMEOUT ?= "10"
5SYSLINUX_LABELS = "boot"
6LABELS_append = " ${SYSLINUX_LABELS} "
7
8# need to define the dependency and the ROOTFS for directdisk
9do_bootdirectdisk[depends] += "${PN}:do_rootfs"
10ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.ext3"
11
12# creating VM images relies on having a hddimg so ensure we inherit it here.
13inherit boot-directdisk
14
15IMAGE_TYPEDEP_vmdk = "ext3"
16IMAGE_TYPEDEP_vdi = "ext3"
17IMAGE_TYPES_MASKED += "vmdk vdi"
18
19create_vmdk_image () {
20 qemu-img convert -O vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk
21 ln -sf ${IMAGE_NAME}.vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.vmdk
22}
23
24create_vdi_image () {
25 qemu-img convert -O vdi ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vdi
26 ln -sf ${IMAGE_NAME}.vdi ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.vdi
27}
28
29python do_vmimg() {
30 if 'vmdk' in d.getVar('IMAGE_FSTYPES', True):
31 bb.build.exec_func('create_vmdk_image', d)
32 if 'vdi' in d.getVar('IMAGE_FSTYPES', True):
33 bb.build.exec_func('create_vdi_image', d)
34}
35
36addtask vmimg after do_bootdirectdisk before do_build
37do_vmimg[depends] += "qemu-native:do_populate_sysroot"
38