Skip to contentSkip to conversation

Pull request - some sync bits from OE

PATCH In review Chris Larson 2 participants 15 messages Mar 17, 2011 – Mar 21, 2011

lore
Share & tools
lore
#0 lore raw

cover Pull request - some sync bits from OE

From: Chris Larson <[email protected]>

This is primarily a sync of a couple OE features, along with a few minor changes to ensure those features work fine for us. More OE sync bits will be forthcoming. These certainly need review. In particular, I haven't gotten any feedback on how the poky folk feel about this approach to IMAGE_FEATURES relative to their own, so please do comment on that, if you would :)

Pull URL: https://github.com/kergoth/oe-core
Branch: oe-sync
Browse: https://github.com/kergoth/oe-core/commits/oe-sync

Thanks,
Chris Larson <[email protected]>
---

Chris Larson (12):
oe.utils: add bb, bb.data imports
oe.patch: add missing imports
oe.path: sync up with current OE
oe.utils: add inherits (sync from OE) base.bbclass: switch to current OE's imports handling Shift oe import logic out of the event handler Implement variable typing (sync from OE) oe.packagegroup: add code for package groups (sync from OE) Move packagedata code into oe.packagedata (sync from OE)
packagedata: don't choke on empty PACKAGES image.bbclass: switch to OE's IMAGE_FEATURES
Use oe.data for IMAGE_FEATURES

 meta/classes/base.bbclass                          |   44 ++++----
 meta/classes/image.bbclass                         |   41 +++++++-
 meta/classes/package.bbclass                       |    4 +-
 meta/classes/package_rpm.bbclass                   |    3 +-
 meta/classes/packagedata.bbclass                   |   68 +------------
 meta/classes/poky-image.bbclass                    |   88 ++++------------
 meta/classes/typecheck.bbclass                     |   12 ++
 meta/conf/bitbake.conf                             |    1 +
 meta/lib/oe/data.py                                |   13 +++
 meta/lib/oe/maketype.py                            |   97 ++++++++++++++++++
 meta/lib/oe/packagedata.py                         |  107 ++++++++++++++++++++
 meta/lib/oe/packagegroup.py                        |   29 ++++++
 meta/lib/oe/patch.py                               |    2 +
 meta/lib/oe/path.py                                |   21 +++--
 meta/lib/oe/test_types.py                          |   62 +++++++++++
 meta/lib/oe/types.py                               |  104 +++++++++++++++++++
 meta/lib/oe/utils.py                               |    6 +
 meta/recipes-core/images/poky-image-minimal-dev.bb |    2 +-
 meta/recipes-extended/images/poky-image-lsb-dev.bb |    2 +-
 meta/recipes-extended/images/poky-image-lsb-sdk.bb |    2 +-
 meta/recipes-sato/images/poky-image-sato-dev.bb    |    2 +-
 meta/recipes-sato/images/poky-image-sato-sdk.bb    |    2 +-
 22 files changed, 544 insertions(+), 168 deletions(-)
 create mode 100644 meta/classes/typecheck.bbclass
 create mode 100644 meta/lib/oe/data.py
 create mode 100644 meta/lib/oe/maketype.py
 create mode 100644 meta/lib/oe/packagedata.py
 create mode 100644 meta/lib/oe/packagegroup.py
 create mode 100644 meta/lib/oe/test_types.py
 create mode 100644 meta/lib/oe/types.py
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 1/12 oe.utils: add bb, bb.data imports

From: Chris Larson <[email protected]>

While the metadata can and should rely on bb always being available, this needn't necessarily be the case for imported python modules.

---
 meta/lib/oe/utils.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
meta/lib/oe/utils.py +2 -0
index 3469700..69f9384 100644
@@ -1,3 +1,5 @@
+import bb, bb.data
+
 def read_file(filename):
     try:
         f = file( filename, "r" )
Signature · 1 line
1.7.2.3
#2 lore raw

PATCH 2/12 oe.patch: add missing imports

In reply to Chris Larson

From: Chris Larson <[email protected]>

---
 meta/lib/oe/patch.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
meta/lib/oe/patch.py +2 -0
index c8eeb8b..5fb687d 100644
@@ -1,4 +1,6 @@
 import oe.path
+import os
+import bb.utils, bb.msg, bb.data, bb.fetch2
 
 class NotFoundError(Exception):
     def __init__(self, path):
Signature · 1 line
1.7.2.3
#3 lore raw

PATCH 3/12 oe.path: sync up with current OE

In reply to Chris Larson

From: Chris Larson <[email protected]>

---
 meta/lib/oe/path.py |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
meta/lib/oe/path.py +14 -7
index 08ddbf2..8eaa3c5 100644
@@ -1,9 +1,12 @@
+import bb
+import errno
+import glob
+import os
 import shutil
 import subprocess
 
 def join(*paths):
     """Like os.path.join but doesn't treat absolute RHS specially"""
-    import os.path
     return os.path.normpath("/".join(paths))
 
 def relative(src, dest):
@@ -18,7 +21,6 @@ def relative(src, dest):
     >>> relative("/tmp", "/tmp/foo/bar")
     foo/bar
     """
-    import os.path
 
     if hasattr(os.path, "relpath"):
         return os.path.relpath(dest, src)
@@ -57,21 +59,19 @@ def copytree(src, dst):
     check_output(cmd, shell=True, stderr=subprocess.STDOUT)
 
 
-def remove(path):
+def remove(path, recurse=True):
     """Equivalent to rm -f or rm -rf"""
-    import os, errno, shutil, glob
     for name in glob.glob(path):
         try:
             os.unlink(name)
         except OSError, exc:
-            if exc.errno == errno.EISDIR:
-                shutil.rmtree(path)
+            if recurse and exc.errno == errno.EISDIR:
+                shutil.rmtree(name)
             elif exc.errno != errno.ENOENT:
                 raise
 
 def symlink(source, destination, force=False):
     """Create a symbolic link"""
-    import os, errno
     try:
         if force:
             remove(destination)
@@ -121,3 +121,10 @@ def check_output(*popenargs, **kwargs):
         raise CalledProcessError(retcode, cmd, output=output)
     return output
 
+def find(dir, **walkoptions):
+    """ Given a directory, recurses into that directory,
+    returning all files as absolute paths. """
+
+    for root, dirs, files in os.walk(dir, **walkoptions):
+        for file in files:
+            yield os.path.join(root, file)
Signature · 1 line
1.7.2.3
#4 lore raw

PATCH 4/12 oe.utils: add inherits (sync from OE)

In reply to Chris Larson

From: Chris Larson <[email protected]>

---
 meta/lib/oe/utils.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
meta/lib/oe/utils.py +4 -0
index 69f9384..f6d4142 100644
@@ -80,3 +80,7 @@ def param_bool(cfg, field, dflt = None):
     elif strvalue in ('no', 'n', 'false', 'f', '0'):
         return False
     raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value))
+
+def inherits(d, *classes):
+    """Return True if the metadata inherits any of the specified classes"""
+    return any(bb.data.inherits_class(cls, d) for cls in classes)
Signature · 1 line
1.7.2.3
#5 lore raw

PATCH 5/12 base.bbclass: switch to current OE's imports handling

In reply to Chris Larson

From: Chris Larson <[email protected]>

The current mechanism makes it easier for classes to add new oe modules to be automatically imported, and thereby made available to python snippets (${@}).

---
 meta/classes/base.bbclass |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)
meta/classes/base.bbclass +9 -12
index e53ebe4..7a87f57 100644
@@ -9,31 +9,28 @@ inherit utility-tasks
 inherit metadata_scm
 inherit buildstats
 
-python sys_path_eh () {
+OE_IMPORTS += "oe.path oe.utils sys os time"
+
+python oe_import () {
     if isinstance(e, bb.event.ConfigParsed):
-        import sys
-        import os
-        import time
+        import os, sys
 
         bbpath = e.data.getVar("BBPATH", True).split(":")
         sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath]
 
         def inject(name, value):
-            """Make a python object accessible from everywhere for the metadata"""
+            """Make a python object accessible from the metadata"""
             if hasattr(bb.utils, "_context"):
                 bb.utils._context[name] = value
             else:
                 __builtins__[name] = value
 
-        import oe.path
-        import oe.utils
-        inject("bb", bb)
-        inject("sys", sys)
-        inject("time", time)
-        inject("oe", oe)
+        for toimport in e.data.getVar("OE_IMPORTS", True).split():
+            imported = __import__(toimport)
+            inject(toimport.split(".", 1)[0], imported)
 }
 
-addhandler sys_path_eh
+addhandler oe_import
 
 die() {
 	oefatal "$*"
Signature · 1 line
1.7.2.3
#6 lore raw

PATCH 6/12 Shift oe import logic out of the event handler

In reply to Chris Larson

From: Chris Larson <[email protected]>

This can be useful if we need the imports from another config parsed event handler, and can't rely upon the base one running before that one.

---
 meta/classes/base.bbclass |   33 ++++++++++++++++++---------------
 1 files changed, 18 insertions(+), 15 deletions(-)
meta/classes/base.bbclass +18 -15
index 7a87f57..a3d4086 100644
@@ -11,26 +11,29 @@ inherit buildstats
 
 OE_IMPORTS += "oe.path oe.utils sys os time"
 
-python oe_import () {
-    if isinstance(e, bb.event.ConfigParsed):
-        import os, sys
+def oe_import(d):
+    import os, sys
+
+    bbpath = d.getVar("BBPATH", True).split(":")
+    sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath]
 
-        bbpath = e.data.getVar("BBPATH", True).split(":")
-        sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath]
+    def inject(name, value):
+        """Make a python object accessible from the metadata"""
+        if hasattr(bb.utils, "_context"):
+            bb.utils._context[name] = value
+        else:
+            __builtins__[name] = value
 
-        def inject(name, value):
-            """Make a python object accessible from the metadata"""
-            if hasattr(bb.utils, "_context"):
-                bb.utils._context[name] = value
-            else:
-                __builtins__[name] = value
+    for toimport in d.getVar("OE_IMPORTS", True).split():
+        imported = __import__(toimport)
+        inject(toimport.split(".", 1)[0], imported)
 
-        for toimport in e.data.getVar("OE_IMPORTS", True).split():
-            imported = __import__(toimport)
-            inject(toimport.split(".", 1)[0], imported)
+python oe_import_eh () {
+    if isinstance(e, bb.event.ConfigParsed):
+	oe_import(e.data)
 }
 
-addhandler oe_import
+addhandler oe_import_eh
 
 die() {
 	oefatal "$*"
Signature · 1 line
1.7.2.3
#7 lore raw

PATCH 7/12 Implement variable typing (sync from OE)

In reply to Chris Larson

From: Chris Larson <[email protected]>

This implementation consists of two components:

- Type creation python modules, whose job it is to construct objects of the defined type for a given variable in the metadata
- typecheck.bbclass, which iterates over all configuration variables with a type defined and uses oe.types to check the validity of the values

This gives us a few benefits:

- Automatic sanity checking of all configuration variables with a defined type
- Avoid duplicating the "how do I make use of the value of this variable" logic between its users. For variables like PATH, this is simply a split(), for boolean variables, the duplication can result in confusing, or even mismatched semantics (is this 0/1, empty/nonempty, what?)
- Make it easier to create a configuration UI, as the type information could be used to provide a better interface than a text edit box (e.g checkbox for 'boolean', dropdown for 'choice')

This functionality is entirely opt-in right now. To enable the configuration variable type checking, simply INHERIT += "typecheck". Example of a failing type check:

BAZ = "foo"
BAZ[type] = "boolean"

$ bitbake -p
FATAL: BAZ: Invalid boolean value 'foo'
$

Examples of leveraging oe.types in a python snippet:

PACKAGES[type] = "list"

python () {
import oe.data
for pkg in oe.data.typed_value("PACKAGES", d):
bb.note("package: %s" % pkg)
}

LIBTOOL_HAS_SYSROOT = "yes"
LIBTOOL_HAS_SYSROOT[type] = "boolean"

python () {
    import oe.data
    assert(oe.data.typed_value("LIBTOOL_HAS_SYSROOT", d) == True)
}
---
 meta/classes/base.bbclass      |    2 +-
 meta/classes/typecheck.bbclass |   12 +++++
 meta/lib/oe/data.py            |   13 +++++
 meta/lib/oe/maketype.py        |   97 +++++++++++++++++++++++++++++++++++++
 meta/lib/oe/test_types.py      |   62 ++++++++++++++++++++++++
 meta/lib/oe/types.py           |  104 ++++++++++++++++++++++++++++++++++++++++
 6 files changed, 289 insertions(+), 1 deletions(-)
 create mode 100644 meta/classes/typecheck.bbclass
 create mode 100644 meta/lib/oe/data.py
 create mode 100644 meta/lib/oe/maketype.py
 create mode 100644 meta/lib/oe/test_types.py
 create mode 100644 meta/lib/oe/types.py
meta/classes/base.bbclass +1 -1
index a3d4086..27a68de 100644
@@ -9,7 +9,7 @@ inherit utility-tasks
 inherit metadata_scm
 inherit buildstats
 
-OE_IMPORTS += "oe.path oe.utils sys os time"
+OE_IMPORTS += "sys os time oe.path oe.utils oe.data"
 
 def oe_import(d):
     import os, sys
meta/classes/typecheck.bbclass new file +12 -0
new file mode 100644
index 0000000..646cd4e
@@ -0,0 +1,12 @@
+# Check types of bitbake configuration variables
+#
+# See oe.types for details.
+
+python check_types() {
+    import oe.types
+    if isinstance(e, bb.event.ConfigParsed):
+        for key in e.data.keys():
+            if e.data.getVarFlag(key, "type"):
+                oe.types.value(key, e.data)
+}
+addhandler check_types
meta/lib/oe/data.py new file +13 -0
new file mode 100644
index 0000000..8b7c3cd
@@ -0,0 +1,13 @@
+import oe.maketype
+import bb.msg
+
+def typed_value(key, d):
+    """Construct a value for the specified metadata variable, using its flags
+    to determine the type and parameters for construction."""
+    var_type = d.getVarFlag(key, 'type')
+    flags = d.getVarFlags(key)
+
+    try:
+        return oe.maketype.create(d.getVar(key, True) or '', var_type, **flags)
+    except (TypeError, ValueError), exc:
+        bb.msg.fatal(bb.msg.domain.Data, "%s: %s" % (key, str(exc)))
meta/lib/oe/maketype.py new file +97 -0

97 lines not on this page · raw message

meta/lib/oe/test_types.py new file +62 -0

62 lines not on this page · raw message

meta/lib/oe/types.py new file +104 -0

104 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#8 lore raw

PATCH 8/12 oe.packagegroup: add code for package groups (sync from OE)

In reply to Chris Larson

From: Chris Larson <[email protected]>

This includes some utility functions for dealing with groups of packages defined in the metadata. Metadata syntax:

PACKAGE_GROUP_<group> = "<list of packages>"

If the packages in the group are optional:

    PACKAGE_GROUP_<group>[optional] = "1"
---
 meta/classes/base.bbclass   |    2 +-
 meta/lib/oe/packagegroup.py |   29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletions(-)
 create mode 100644 meta/lib/oe/packagegroup.py
meta/classes/base.bbclass +1 -1
index 27a68de..8e8d572 100644
@@ -9,7 +9,7 @@ inherit utility-tasks
 inherit metadata_scm
 inherit buildstats
 
-OE_IMPORTS += "sys os time oe.path oe.utils oe.data"
+OE_IMPORTS += "sys os time oe.path oe.utils oe.data oe.packagegroup"
 
 def oe_import(d):
     import os, sys
meta/lib/oe/packagegroup.py new file +29 -0
new file mode 100644
index 0000000..b04c45a
@@ -0,0 +1,29 @@
+import itertools
+
+def is_optional(group, d):
+    return bool(d.getVarFlag("PACKAGE_GROUP_%s" % group, "optional"))
+
+def packages(groups, d):
+    for group in groups:
+        for pkg in (d.getVar("PACKAGE_GROUP_%s" % group, True) or "").split():
+            yield pkg
+
+def required_packages(groups, d):
+    req = filter(lambda group: not is_optional(group, d), groups)
+    return packages(req, d)
+
+def optional_packages(groups, d):
+    opt = filter(lambda group: is_optional(group, d), groups)
+    return packages(opt, d)
+
+def active_packages(features, d):
+    return itertools.chain(required_packages(features, d),
+                           optional_packages(features, d))
+
+def active_recipes(features, d):
+    import oe.packagedata
+
+    for pkg in active_packages(features, d):
+        recipe = oe.packagedata.recipename(pkg, d)
+        if recipe:
+            yield recipe
Signature · 1 line
1.7.2.3
#9 lore raw

PATCH 9/12 Move packagedata code into oe.packagedata (sync from OE)

In reply to Chris Larson

From: Chris Larson <[email protected]>

---
 meta/classes/package.bbclass     |    4 +-
 meta/classes/package_rpm.bbclass |    3 +-
 meta/classes/packagedata.bbclass |   68 ++-----------------------
 meta/lib/oe/packagedata.py       |  106 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 115 insertions(+), 66 deletions(-)
 create mode 100644 meta/lib/oe/packagedata.py
meta/classes/package.bbclass +3 -1
index e6b3df7..fddf5b1 100644
@@ -295,7 +295,9 @@ def runstrip(file, elftype, d):
 #
 
 def get_package_mapping (pkg, d):
-	data = read_subpkgdata(pkg, d)
+	import oe.packagedata
+
+	data = oe.packagedata.read_subpkgdata(pkg, d)
 	key = "PKG_%s" % pkg
 
 	if key in data:
meta/classes/package_rpm.bbclass +2 -1
index 4647116..236e613 100644
@@ -316,6 +316,7 @@ package_install_internal_rpm () {
 
 python write_specfile () {
 	import textwrap
+	import oe.packagedata
 
 	# We need to change '-' in a version field to '+'
 	# This needs to be done BEFORE the mapping_rename_hook
@@ -328,7 +329,7 @@ python write_specfile () {
 				ver = depends_dict[dep]
 				if dep and ver:
 					if '-' in ver:
-						subd = read_subpkgdata_dict(dep, d)
+						subd = oe.packagedata.read_subpkgdata_dict(dep, d)
 						pv = subd['PV']
 						reppv = pv.replace('-', '+')
 						ver = ver.replace(pv, reppv)
meta/classes/packagedata.bbclass +4 -64

77 lines not on this page · raw message

meta/lib/oe/packagedata.py new file +106 -0

106 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#10 lore raw

PATCH 10/12 packagedata: don't choke on empty PACKAGES

In reply to Chris Larson

From: Chris Larson <[email protected]>

---
 meta/lib/oe/packagedata.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
meta/lib/oe/packagedata.py +2 -1
index 7f0a89d..ee10a23 100644
@@ -84,7 +84,8 @@ def _pkgmap(d):
             except OSError:
                 continue
 
-            for pkg in pkgdata["PACKAGES"].split():
+            packages = pkgdata.get("PACKAGES") or ""
+            for pkg in packages.split():
                 pkgmap[pkg] = pn
 
     return pkgmap
Signature · 1 line
1.7.2.3
#11 lore raw

PATCH 11/12 image.bbclass: switch to OE's IMAGE_FEATURES

In reply to Chris Larson

From: Chris Larson <[email protected]>

Currently, all image features are assumed to be package groups defined with oe.packagegroup (PACKAGE_GROUP_<group> = "<list of packages>").

---
 meta/classes/image.bbclass                         |   41 +++++++++-
 meta/classes/poky-image.bbclass                    |   88 +++++---------------
 meta/conf/bitbake.conf                             |    1 +
 meta/recipes-core/images/poky-image-minimal-dev.bb |    2 +-
 meta/recipes-extended/images/poky-image-lsb-dev.bb |    2 +-
 meta/recipes-extended/images/poky-image-lsb-sdk.bb |    2 +-
 meta/recipes-sato/images/poky-image-sato-dev.bb    |    2 +-
 meta/recipes-sato/images/poky-image-sato-sdk.bb    |    2 +-
 8 files changed, 67 insertions(+), 73 deletions(-)
meta/classes/image.bbclass +39 -2
index 2cc17e1..5d89598 100644
@@ -11,8 +11,45 @@ INHIBIT_DEFAULT_DEPS = "1"
 
 # "export IMAGE_BASENAME" not supported at this time
 IMAGE_BASENAME[export] = "1"
-export PACKAGE_INSTALL ?= "${IMAGE_INSTALL}"
-PACKAGE_INSTALL_ATTEMPTONLY ?= ""
+
+PACKAGE_INSTALL = "${@' '.join(oe.packagegroup.required_packages('${IMAGE_FEATURES}'.split(), d))}"
+PACKAGE_INSTALL_ATTEMPTONLY = "${@' '.join(oe.packagegroup.optional_packages('${IMAGE_FEATURES}'.split(), d))}"
+RDEPENDS += "${@' '.join(oe.packagegroup.active_packages('${IMAGE_FEATURES}'.split(), d))}"
+
+
+IMAGE_FEATURES ?= ""
+IMAGE_FEATURES[type] = "list"
+IMAGE_FEATURES_prepend = "image_base "
+
+# Define our always included package group
+PACKAGE_GROUP_image_base = "${IMAGE_INSTALL}"
+
+# The following package groups allow one to add debugging, development, and
+# documentation files for all packages installed in the image.
+
+def string_set(iterable):
+    return ' '.join(set(iterable))
+
+def image_features_noextras(d):
+    for f in d.getVar("IMAGE_FEATURES", True).split():
+        if not f in ('dbg', 'dev', 'doc'):
+            yield f
+
+def dbg_packages(d):
+    from itertools import chain
+
+    features = image_features_noextras(d)
+    return string_set("%s-dbg" % pkg
+                      for pkg in chain(oe.packagegroup.active_packages(features, d),
+                                       oe.packagegroup.active_recipes(features, d)))
+
+PACKAGE_GROUP_dbg = "${@dbg_packages(d)}"
+PACKAGE_GROUP_dbg[optional] = "1"
+PACKAGE_GROUP_dev = "${@string_set('%s-dev' % pn for pn in oe.packagegroup.active_recipes(image_features_noextras(d), d))}"
+PACKAGE_GROUP_dev[optional] = "1"
+PACKAGE_GROUP_doc = "${@string_set('%s-doc' % pn for pn in oe.packagegroup.active_recipes(image_features_noextras(d), d))}"
+PACKAGE_GROUP_doc[optional] = "1"
+
 
 # We need to recursively follow RDEPENDS and RRECOMMENDS for images
 do_rootfs[recrdeptask] += "do_deploy do_populate_sysroot"
meta/classes/poky-image.bbclass +22 -66

105 lines not on this page · raw message

meta/conf/bitbake.conf +1 -0
index 42b9825..c49a737 100644
@@ -726,6 +726,7 @@ MACHINE_EXTRA_RDEPENDS ?= ""
 MACHINE_EXTRA_RRECOMMENDS ?= ""
 MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
+EXTRA_IMAGE_FEATURES ?= ""
 IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
 
 COMBINED_FEATURES = "\
meta/recipes-core/images/poky-image-minimal-dev.bb +1 -1
index c64b657..e65a942 100644
@@ -3,7 +3,7 @@
 #
 IMAGE_INSTALL = "task-poky-boot ${ROOTFS_PKGMANAGE}"
 
-IMAGE_FEATURES += "dev-pkgs"
+IMAGE_FEATURES += "dev"
 
 IMAGE_LINGUAS = " "
 
meta/recipes-extended/images/poky-image-lsb-dev.bb +1 -1
index 578fbd0..f549ba0 100644
@@ -1,4 +1,4 @@
-IMAGE_FEATURES += "apps-console-core dev-pkgs ssh-server-openssh"
+IMAGE_FEATURES += "apps-console-core dev ssh-server-openssh"
 
 IMAGE_INSTALL = "\
     ${POKY_BASE_INSTALL} \
meta/recipes-extended/images/poky-image-lsb-sdk.bb +1 -1
index 967bb02..54a1d73 100644
@@ -1,4 +1,4 @@
-IMAGE_FEATURES += "apps-console-core tools-debug tools-profile tools-sdk dev-pkgs ssh-server-openssh"
+IMAGE_FEATURES += "apps-console-core tools-debug tools-profile tools-sdk dev ssh-server-openssh"
 
 IMAGE_INSTALL = "\
     ${POKY_BASE_INSTALL} \
meta/recipes-sato/images/poky-image-sato-dev.bb +1 -1
index 429095e..50b3c34 100644
@@ -2,7 +2,7 @@
 # Copyright (C) 2007 OpenedHand Ltd.
 #
 
-IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} dev-pkgs"
+IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} dev"
 
 LICENSE = "MIT"
 
meta/recipes-sato/images/poky-image-sato-sdk.bb +1 -1
index 9f8eef9..d15236e 100644
@@ -2,7 +2,7 @@
 # Copyright (C) 2007 OpenedHand Ltd.
 #
 
-IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} tools-debug tools-profile tools-sdk dev-pkgs qt4-pkgs"
+IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} tools-debug tools-profile tools-sdk dev qt4-pkgs"
 
 LICENSE = "MIT"
 
Signature · 1 line
1.7.2.3
#12 lore raw
In reply to Chris Larson
Quoted 8 lines · Chris Larson

From: Chris Larson <[email protected]>

This is primarily a sync of a couple OE features, along with a few minor changes to ensure those features work fine for us.  More OE sync bits will be forthcoming.  These certainly need review.  In particular, I haven't gotten any feedback on how the poky folk feel about this approach to IMAGE_FEATURES relative to their own, so please do comment on that, if you would :)

Quoted 8 lines

Pull URL: https://github.com/kergoth/oe-core

 Branch: oe-sync
 Browse: https://github.com/kergoth/oe-core/commits/oe-sync

Thanks,
   Chris Larson <[email protected]>

Erm, I forgot I hadn't yet dealt with ROOTFS_PACKAGEMANAGE_BOOTSTRAP, in the IMAGE_FEATURES changes, don't pull this until I resolve that :)

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
#13 lore raw
Quoted 15 lines · Chris Larson
Quoted 14 lines · Chris Larson

From: Chris Larson <[email protected]>

This is primarily a sync of a couple OE features, along with a few minor changes to ensure those features work fine for us. More OE sync bits will be forthcoming. These certainly need review. In particular, I haven't gotten any feedback on how the poky folk feel about this approach to IMAGE_FEATURES relative to their own, so please do comment on that, if you would :)

Pull URL: https://github.com/kergoth/oe-core

Branch: oe-sync
Browse: https://github.com/kergoth/oe-core/commits/oe-sync

Quoted 5 lines
Quoted 2 lines

Thanks,
Chris Larson <[email protected]>

Erm, I forgot I hadn't yet dealt with ROOTFS_PACKAGEMANAGE_BOOTSTRAP, in the IMAGE_FEATURES changes, don't pull this until I resolve that :)

Ok, I've pulled the first four commits for now since there were fairly obvious fixes and not part of what you mention above, I'll wait for another pull request for the rest.

Cheers,

Richard

#14 lore raw

PATCH 12/12 Use oe.data for IMAGE_FEATURES

In reply to Chris Larson

From: Chris Larson <[email protected]>

---
 meta/classes/image.bbclass |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
meta/classes/image.bbclass +6 -6
index 5d89598..9b5c287 100644
@@ -12,9 +12,9 @@ INHIBIT_DEFAULT_DEPS = "1"
 # "export IMAGE_BASENAME" not supported at this time
 IMAGE_BASENAME[export] = "1"
 
-PACKAGE_INSTALL = "${@' '.join(oe.packagegroup.required_packages('${IMAGE_FEATURES}'.split(), d))}"
-PACKAGE_INSTALL_ATTEMPTONLY = "${@' '.join(oe.packagegroup.optional_packages('${IMAGE_FEATURES}'.split(), d))}"
-RDEPENDS += "${@' '.join(oe.packagegroup.active_packages('${IMAGE_FEATURES}'.split(), d))}"
+PACKAGE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
+PACKAGE_INSTALL_ATTEMPTONLY = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
+RDEPENDS += "${@' '.join(oe.packagegroup.active_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
 
 
 IMAGE_FEATURES ?= ""
@@ -31,9 +31,9 @@ def string_set(iterable):
     return ' '.join(set(iterable))
 
 def image_features_noextras(d):
-    for f in d.getVar("IMAGE_FEATURES", True).split():
-        if not f in ('dbg', 'dev', 'doc'):
-            yield f
+    for feature in oe.data.typed_value('IMAGE_FEATURES', d):
+        if not feature in ('dbg', 'dev', 'doc'):
+            yield feature
 
 def dbg_packages(d):
     from itertools import chain
Signature · 1 line
1.7.2.3