summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2011-07-26 08:30:08 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-27 12:02:46 +0100
commitba8a726b7dbbca8e9ea9cc75964d366d094aa881 (patch)
tree17e3da2faf29153fb9c17ec12330e3fc7536b957
parent39130137e40fe62d7b9bf2c9226a082138217b37 (diff)
downloadpoky-ba8a726b7dbbca8e9ea9cc75964d366d094aa881.tar.gz
classes/image*: Revamp creation of live images
This creates a live image as an IMAGE_FSTYPES, thus removing the need to have additional -live.bb recipes. To create a live image one just needs to add live to the IMAGE_FSTYPES list (From OE-Core rev: b3ff63796cd6629975ff0a726ba18cc168e0a2b2) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/image-empty.bbclass0
-rw-r--r--meta/classes/image-live.bbclass13
-rw-r--r--meta/classes/image.bbclass3
-rw-r--r--meta/classes/image_types.bbclass15
4 files changed, 29 insertions, 2 deletions
diff --git a/meta/classes/image-empty.bbclass b/meta/classes/image-empty.bbclass
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta/classes/image-empty.bbclass
diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass
new file mode 100644
index 0000000000..c910488d64
--- /dev/null
+++ b/meta/classes/image-live.bbclass
@@ -0,0 +1,13 @@
1
2AUTO_SYSLINUXCFG = "1"
3INITRD = "${DEPLOY_DIR_IMAGE}/core-image-minimal-initramfs-${MACHINE}.cpio.gz"
4APPEND += "root=/dev/ram0 "
5TIMEOUT = "10"
6LABELS += "boot install"
7
8ROOTFS = "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.ext3"
9
10do_bootimg[depends] += "core-image-minimal-initramfs:do_rootfs"
11do_bootimg[depends] += "${IMAGE_BASENAME}:do_rootfs"
12
13inherit bootimg
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index edfb2d68c5..79a56f0408 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -29,6 +29,9 @@ LDCONFIGDEPEND_libc-uclibc = ""
29do_rootfs[depends] += "makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ${LDCONFIGDEPEND}" 29do_rootfs[depends] += "makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ${LDCONFIGDEPEND}"
30do_rootfs[depends] += "virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot" 30do_rootfs[depends] += "virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot"
31 31
32IMAGE_TYPE = ${@base_contains("IMAGE_FSTYPES", "live", "live", "empty", d)}
33inherit image-${IMAGE_TYPE}
34
32python () { 35python () {
33 deps = bb.data.getVarFlag('do_rootfs', 'depends', d) or "" 36 deps = bb.data.getVarFlag('do_rootfs', 'depends', d) or ""
34 for type in (bb.data.getVar('IMAGE_FSTYPES', d, True) or "").split(): 37 for type in (bb.data.getVar('IMAGE_FSTYPES', d, True) or "").split():
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index f1aef86fad..cd901c105f 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -1,7 +1,18 @@
1
1def get_imagecmds(d): 2def get_imagecmds(d):
2 cmds = "\n" 3 cmds = "\n"
3 old_overrides = bb.data.getVar('OVERRIDES', d, 0) 4 old_overrides = bb.data.getVar('OVERRIDES', d, 0)
4 for type in bb.data.getVar('IMAGE_FSTYPES', d, True).split(): 5
6 types = bb.data.getVar('IMAGE_FSTYPES', d, True).split()
7 # Live images will be processed via inheriting bbclass and
8 # does not get processed here.
9 # live images also depend on ext3 so ensure its present
10 if "live" in types:
11 if "ext3" not in types:
12 types.append("ext3")
13 types.remove("live")
14
15 for type in types:
5 localdata = bb.data.createCopy(d) 16 localdata = bb.data.createCopy(d)
6 localdata.setVar('OVERRIDES', '%s:%s' % (type, old_overrides)) 17 localdata.setVar('OVERRIDES', '%s:%s' % (type, old_overrides))
7 bb.data.update_data(localdata) 18 bb.data.update_data(localdata)
@@ -103,4 +114,4 @@ IMAGE_DEPENDS_ubi = "mtd-utils-native"
103IMAGE_DEPENDS_ubifs = "mtd-utils-native" 114IMAGE_DEPENDS_ubifs = "mtd-utils-native"
104 115
105# This variable is available to request which values are suitable for IMAGE_FSTYPES 116# This variable is available to request which values are suitable for IMAGE_FSTYPES
106IMAGE_TYPES = "jffs2 cramfs ext2 ext2.gz ext3 ext3.gz squashfs squashfs-lzma ubi tar tar.gz tar.bz2 tar.xz cpio cpio.gz cpio.xz cpio.lzma" 117IMAGE_TYPES = "jffs2 cramfs ext2 ext2.gz ext3 ext3.gz live squashfs squashfs-lzma ubi tar tar.gz tar.bz2 tar.xz cpio cpio.gz cpio.xz cpio.lzma"