aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2013-02-01 18:06:42 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2014-04-02 19:51:42 +0200
commit911aede760138a47b9b2e2b7001b85f386ec990d (patch)
treee0479afb1134346d9c628da303fae4b0e7e335d6
parent54c74e4fd1334e365cfca75b171d7060be3e02f3 (diff)
downloadopenembedded-core-contrib-jansa/target-image.tar.gz
targets-list-image: add ad-hoc image created from recipes used on command linejansa/target-image
* creates IMAGE_INSTALL dynamically based on targets used on bitbake command line Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta/classes/targets-list-image.bbclass32
-rw-r--r--meta/recipes-core/images/targets-list-image.bb15
2 files changed, 47 insertions, 0 deletions
diff --git a/meta/classes/targets-list-image.bbclass b/meta/classes/targets-list-image.bbclass
new file mode 100644
index 0000000000..7c05cd3818
--- /dev/null
+++ b/meta/classes/targets-list-image.bbclass
@@ -0,0 +1,32 @@
+python collect_packages () {
+ import oe.packagedata
+ if isinstance(e, bb.event.TargetsListGenerated):
+ #bb.warn("bb.event.TargetsListGenerated e '%s'" % e._model)
+ pkgs_to_install = []
+ for pn in e._model:
+ data = oe.packagedata.read_pkgdata(pn, e.data)
+ excluded = 'EXCLUDE_FROM_WORLD' in data and data['EXCLUDE_FROM_WORLD'] == '1'
+ excluded_image = 'EXCLUDE_FROM_WORLD_IMAGE' in data and data['EXCLUDE_FROM_WORLD_IMAGE'] == '1'
+ if excluded or excluded_image:
+ #bb.warn("Skipping whole '%s' because it's explicitly excluded from world(-image)" % pn)
+ continue
+
+ if 'PACKAGES' in data:
+ pkgs = data['PACKAGES'].split()
+ if 'EXCLUDE_PACKAGES_FROM_WORLD_IMAGE' in data:
+ excluded_packages = data['EXCLUDE_PACKAGES_FROM_WORLD_IMAGE'].split()
+ for pkg in pkgs:
+ if pkg not in excluded_packages:
+ pkgs_to_install.append(pkg)
+# else:
+# bb.warn("Skipping '%s' from '%s' because it's explicitly excluded from world-image" % (pkg, pn))
+ else:
+ pkgs_to_install.extend(pkgs)
+# else:
+# bb.warn("No packages in '%s'" % pn)
+
+ bb.warn("pkgs_to_install after '%s': '%s'" % (pn, pkgs_to_install))
+ e.data.setVar("IMAGE_INSTALL_pn-targets-list-image", ' '.join(pkgs_to_install))
+}
+
+addhandler collect_packages
diff --git a/meta/recipes-core/images/targets-list-image.bb b/meta/recipes-core/images/targets-list-image.bb
new file mode 100644
index 0000000000..25fb147a91
--- /dev/null
+++ b/meta/recipes-core/images/targets-list-image.bb
@@ -0,0 +1,15 @@
+# IMAGE_INSTALL is set to union of all PACKAGES
+# from all recipes listed on command line which
+# are not marked as:
+# EXCLUDE_FROM_WORLD or EXCLUDE_FROM_WORLD_IMAGE
+# or individual packages listed in
+# EXCLUDE_PACKAGES_FROM_WORLD_IMAGE
+# You can use this to create "world-image" by:
+# bitbake world targets-list-image
+
+inherit targets-list-image
+inherit image
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+