[OE-core] [PATCH 1/1] sanity.bbclass: a new check for required distro features

nitin.a.kamble at intel.com nitin.a.kamble at intel.com
Mon Aug 19 19:22:19 UTC 2013


From: Nitin A Kamble <nitin.a.kamble at intel.com>

Some BSPs need to have some specific distro_features enabled. These
BSPs fail to build when these required DISTRO features are not
enabled. And the issue is, there is no clue in the build error, about
why the build is failing.

  This commit addresses the issue by adding a generic mechanism to
check for enablement of the required distro features.

Now these BSPs can specify in their BSP config, what distro features
are required, and if these are not enabled then appropriate build
error is thrown to help fix the issue.

Signed-off-by: Nitin A Kamble <nitin.a.kamble at intel.com>
---
 meta/classes/sanity.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 4df3ca8..6f9ad5f 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -603,6 +603,13 @@ def check_sanity_everybuild(status, d):
         if not ( check_conf_exists("conf/distro/${DISTRO}.conf", d) or check_conf_exists("conf/distro/include/${DISTRO}.inc", d) ):
             status.addresult("DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % d.getVar("DISTRO", True))
 
+    # check all the required DISTRO_FEATURES are enabled
+    distro_features_split = (d.getVar('DISTRO_FEATURES', True) or "").split()
+    required_distro_features_split = (d.getVar('REQUIRED_DISTRO_FEATURES', True) or "").split()
+    for rdf in required_distro_features_split:
+        if rdf not in distro_features_split:
+            status.addresult("%s is required in DISTRO_FEATURES" % rdf)
+
     # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't 
     # set, since so much relies on it being set.
     dldir = d.getVar('DL_DIR', True)
-- 
1.8.1.4




More information about the Openembedded-core mailing list