summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/image-vm.bbclass38
-rw-r--r--meta/classes/image-vmdk.bbclass35
-rw-r--r--meta/classes/image.bbclass6
-rw-r--r--meta/classes/image_types.bbclass5
-rw-r--r--meta/lib/oe/image.py4
5 files changed, 46 insertions, 42 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
diff --git a/meta/classes/image-vmdk.bbclass b/meta/classes/image-vmdk.bbclass
deleted file mode 100644
index 77b7facd41..0000000000
--- a/meta/classes/image-vmdk.bbclass
+++ /dev/null
@@ -1,35 +0,0 @@
1
2#NOISO = "1"
3
4SYSLINUX_ROOT ?= "root=/dev/sda2"
5SYSLINUX_PROMPT ?= "0"
6SYSLINUX_TIMEOUT ?= "10"
7SYSLINUX_LABELS = "boot"
8LABELS_append = " ${SYSLINUX_LABELS} "
9
10# need to define the dependency and the ROOTFS for directdisk
11do_bootdirectdisk[depends] += "${PN}:do_rootfs"
12ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.ext3"
13
14# creating VMDK relies on having a live hddimg so ensure we
15# inherit it here.
16#inherit image-live
17inherit boot-directdisk
18
19IMAGE_TYPEDEP_vmdk = "ext3"
20IMAGE_TYPES_MASKED += "vmdk"
21
22create_vmdk_image () {
23 qemu-img convert -O vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk
24 ln -sf ${IMAGE_NAME}.vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.vmdk
25}
26
27python do_vmdkimg() {
28 bb.build.exec_func('create_vmdk_image', d)
29}
30
31#addtask vmdkimg after do_bootimg before do_build
32addtask vmdkimg after do_bootdirectdisk before do_build
33
34do_vmdkimg[depends] += "qemu-native:do_populate_sysroot"
35
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 58b4add8fa..64ae2cb92b 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -130,10 +130,10 @@ def build_live(d):
130 return "image-live" 130 return "image-live"
131 131
132IMAGE_TYPE_live = "${@build_live(d)}" 132IMAGE_TYPE_live = "${@build_live(d)}"
133
134inherit ${IMAGE_TYPE_live} 133inherit ${IMAGE_TYPE_live}
135IMAGE_TYPE_vmdk = '${@bb.utils.contains("IMAGE_FSTYPES", "vmdk", "image-vmdk", "", d)}' 134
136inherit ${IMAGE_TYPE_vmdk} 135IMAGE_TYPE_vm = '${@bb.utils.contains_any("IMAGE_FSTYPES", ["vmdk", "vdi"], "image-vm", "", d)}'
136inherit ${IMAGE_TYPE_vm}
137 137
138python () { 138python () {
139 deps = " " + imagetypes_getdepends(d) 139 deps = " " + imagetypes_getdepends(d)
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 72c7337b6b..d86d108c47 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -13,7 +13,7 @@ def imagetypes_getdepends(d):
13 deps = [] 13 deps = []
14 ctypes = d.getVar('COMPRESSIONTYPES', True).split() 14 ctypes = d.getVar('COMPRESSIONTYPES', True).split()
15 for type in (d.getVar('IMAGE_FSTYPES', True) or "").split(): 15 for type in (d.getVar('IMAGE_FSTYPES', True) or "").split():
16 if type in ["vmdk", "live", "iso", "hddimg"]: 16 if type in ["vmdk", "vdi", "live", "iso", "hddimg"]:
17 type = "ext3" 17 type = "ext3"
18 basetype = type 18 basetype = type
19 for ctype in ctypes: 19 for ctype in ctypes:
@@ -155,6 +155,7 @@ IMAGE_TYPES = " \
155 tar tar.gz tar.bz2 tar.xz tar.lz4 \ 155 tar tar.gz tar.bz2 tar.xz tar.lz4 \
156 cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \ 156 cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \
157 vmdk \ 157 vmdk \
158 vdi \
158 elf \ 159 elf \
159" 160"
160 161
@@ -181,5 +182,5 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
181IMAGE_EXTENSION_live = "hddimg iso" 182IMAGE_EXTENSION_live = "hddimg iso"
182 183
183# The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES, 184# The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES,
184# images that will not be built at do_rootfs time: vmdk, hddimg, iso, etc. 185# images that will not be built at do_rootfs time: vmdk, vdi, hddimg, iso, etc.
185IMAGE_TYPES_MASKED ?= "" 186IMAGE_TYPES_MASKED ?= ""
diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
index 0ce303d570..40f61515eb 100644
--- a/meta/lib/oe/image.py
+++ b/meta/lib/oe/image.py
@@ -66,7 +66,7 @@ class ImageDepGraph(object):
66 return graph 66 return graph
67 67
68 def _clean_graph(self): 68 def _clean_graph(self):
69 # Live and VMDK images will be processed via inheriting 69 # Live and VMDK/VDI images will be processed via inheriting
70 # bbclass and does not get processed here. Remove them from the fstypes 70 # bbclass and does not get processed here. Remove them from the fstypes
71 # graph. Their dependencies are already added, so no worries here. 71 # graph. Their dependencies are already added, so no worries here.
72 remove_list = (self.d.getVar('IMAGE_TYPES_MASKED', True) or "").split() 72 remove_list = (self.d.getVar('IMAGE_TYPES_MASKED', True) or "").split()
@@ -76,7 +76,7 @@ class ImageDepGraph(object):
76 76
77 def _image_base_type(self, type): 77 def _image_base_type(self, type):
78 ctypes = self.d.getVar('COMPRESSIONTYPES', True).split() 78 ctypes = self.d.getVar('COMPRESSIONTYPES', True).split()
79 if type in ["vmdk", "live", "iso", "hddimg"]: 79 if type in ["vmdk", "vdi", "live", "iso", "hddimg"]:
80 type = "ext3" 80 type = "ext3"
81 basetype = type 81 basetype = type
82 for ctype in ctypes: 82 for ctype in ctypes: