summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2012-02-29 23:46:21 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-01 15:51:40 +0000
commit0e56519b33a961cb7e7ff123aad2ca5b94ade6eb (patch)
treed8e4fde014ed1287509c9cee0ee79625a521048e /meta/classes
parent157b44cf72c8660ba53b8fe1b321d2ef314c07ef (diff)
downloadpoky-0e56519b33a961cb7e7ff123aad2ca5b94ade6eb.tar.gz
image-vmdk: Create image_vmdk class and setup image and image_types to use it
This creates a new image_vmdk class similar to live. The image_vmdk class needs to have a hddimg created by the image-live class, so it inherits it directly. The changes to image_types is to ensure that both live and vmdk images get the ext3 tools and dependencies. (From OE-Core rev: aa961e112b07d42c272e01f2d69f3c139e9ae70f) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/image-vmdk.bbclass22
-rw-r--r--meta/classes/image.bbclass6
-rw-r--r--meta/classes/image_types.bbclass15
3 files changed, 35 insertions, 8 deletions
diff --git a/meta/classes/image-vmdk.bbclass b/meta/classes/image-vmdk.bbclass
new file mode 100644
index 0000000000..d3e548178b
--- /dev/null
+++ b/meta/classes/image-vmdk.bbclass
@@ -0,0 +1,22 @@
1
2SYSLINUX_PROMPT = "0"
3SYSLINUX_TIMEOUT = "1"
4SYSLINUX_LABELS = "boot"
5
6# creating VMDK relies on having a live hddimg so ensure we
7# inherit it here.
8inherit image-live
9
10create_vmdk_image () {
11 qemu-img convert -O vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk
12}
13
14python do_vmdkimg() {
15 bb.build.exec_func('create_vmdk_image', d)
16}
17
18addtask vmdkimg after do_bootimg before do_build
19do_vmdkimg[nostamp] = "1"
20
21do_vmdkimg[depends] += "qemu-native:do_populate_sysroot"
22
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index ec75cc1e6b..dfce381393 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -70,8 +70,10 @@ LDCONFIGDEPEND_libc-uclibc = ""
70do_rootfs[depends] += "makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ${LDCONFIGDEPEND}" 70do_rootfs[depends] += "makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ${LDCONFIGDEPEND}"
71do_rootfs[depends] += "virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot" 71do_rootfs[depends] += "virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot"
72 72
73IMAGE_TYPE = '${@base_contains("IMAGE_FSTYPES", "live", "live", "empty", d)}' 73IMAGE_TYPE_live = '${@base_contains("IMAGE_FSTYPES", "live", "live", "empty", d)}'
74inherit image-${IMAGE_TYPE} 74inherit image-${IMAGE_TYPE_live}
75IMAGE_TYPE_vmdk = '${@base_contains("IMAGE_FSTYPES", "vmdk", "vmdk", "empty", d)}'
76inherit image-${IMAGE_TYPE_vmdk}
75 77
76python () { 78python () {
77 deps = d.getVarFlag('do_rootfs', 'depends') or "" 79 deps = d.getVarFlag('do_rootfs', 'depends') or ""
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 5b48a09da4..f756c39fc3 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -18,9 +18,13 @@ def get_imagecmds(d):
18 cimages[basetype].append(ctype) 18 cimages[basetype].append(ctype)
19 break 19 break
20 20
21 # Live images will be processed via inheriting bbclass and 21 # Live and VMDK images will be processed via inheriting
22 # does not get processed here. 22 # bbclass and does not get processed here.
23 # live images also depend on ext3 so ensure its present 23 # vmdk depend on live images also depend on ext3 so ensure its present
24 if "vmdk" in types:
25 if "ext3" not in types:
26 types.append("ext3")
27 types.remove("vmdk")
24 if "live" in types: 28 if "live" in types:
25 if "ext3" not in types: 29 if "ext3" not in types:
26 types.append("ext3") 30 types.append("ext3")
@@ -75,6 +79,8 @@ def imagetypes_getdepends(d):
75 deps = [] 79 deps = []
76 ctypes = d.getVar('COMPRESSIONTYPES', True).split() 80 ctypes = d.getVar('COMPRESSIONTYPES', True).split()
77 for type in (d.getVar('IMAGE_FSTYPES', True) or "").split(): 81 for type in (d.getVar('IMAGE_FSTYPES', True) or "").split():
82 if type == "vmdk" or type == "live":
83 type = "ext3"
78 basetype = type 84 basetype = type
79 for ctype in ctypes: 85 for ctype in ctypes:
80 if type.endswith("." + ctype): 86 if type.endswith("." + ctype):
@@ -160,8 +166,6 @@ IMAGE_CMD_ubi () {
160} 166}
161IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs ${MKUBIFS_ARGS}" 167IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs ${MKUBIFS_ARGS}"
162 168
163IMAGE_CMD_vmdk = "qemu-img convert -O vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk"
164
165EXTRA_IMAGECMD = "" 169EXTRA_IMAGECMD = ""
166EXTRA_IMAGECMD_jffs2 ?= "--pad --little-endian --eraseblock=0x40000" 170EXTRA_IMAGECMD_jffs2 ?= "--pad --little-endian --eraseblock=0x40000"
167# Change these if you want default genext2fs behavior (i.e. create minimal inode number) 171# Change these if you want default genext2fs behavior (i.e. create minimal inode number)
@@ -181,7 +185,6 @@ IMAGE_DEPENDS_squashfs = "squashfs-tools-native"
181IMAGE_DEPENDS_squashfs-lzma = "squashfs-lzma-tools-native" 185IMAGE_DEPENDS_squashfs-lzma = "squashfs-lzma-tools-native"
182IMAGE_DEPENDS_ubi = "mtd-utils-native" 186IMAGE_DEPENDS_ubi = "mtd-utils-native"
183IMAGE_DEPENDS_ubifs = "mtd-utils-native" 187IMAGE_DEPENDS_ubifs = "mtd-utils-native"
184IMAGE_DEPENDS_vmdk = "qemu-native"
185 188
186# This variable is available to request which values are suitable for IMAGE_FSTYPES 189# This variable is available to request which values are suitable for IMAGE_FSTYPES
187IMAGE_TYPES = "jffs2 sum.jffs2 cramfs ext2 ext2.gz ext2.bz2 ext3 ext3.gz ext2.lzma btrfs live squashfs squashfs-lzma ubi tar tar.gz tar.bz2 tar.xz cpio cpio.gz cpio.xz cpio.lzma vmdk" 190IMAGE_TYPES = "jffs2 sum.jffs2 cramfs ext2 ext2.gz ext2.bz2 ext3 ext3.gz ext2.lzma btrfs live squashfs squashfs-lzma ubi tar tar.gz tar.bz2 tar.xz cpio cpio.gz cpio.xz cpio.lzma vmdk"