]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/populate_sdk_ext: add a better config extension mechanism
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 19 Feb 2016 09:41:58 +0000 (22:41 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 21 Feb 2016 09:32:01 +0000 (09:32 +0000)
The sdk_extraconf() method of setting the configuration was awkward
since you needed to set it in a class and then inherit that class since
function definitions aren't allowed in conf files. It seemed to me the
a neater way to do this was to read the extra lines from an additional
conf file sdk-extra.conf (which can be located in a conf/ directory
anywhere along BBPATH as with other configuration files).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/populate_sdk_ext.bbclass

index 1c1bb47687ef9968c373131a3d7242a5a7e84f76..a6badb84c6637692774ec44684613ed9e960b46e 100644 (file)
@@ -188,7 +188,15 @@ python copy_buildsystem () {
         # Hide the config information from bitbake output (since it's fixed within the SDK)
         f.write('BUILDCFG_HEADER = ""\n')
 
+        # Allow additional config through sdk-extra.conf
+        fn = bb.cookerdata.findConfigFile('sdk-extra.conf', d)
+        if fn:
+            with open(fn, 'r') as xf:
+                for line in xf:
+                    f.write(line)
+
         # If you define a sdk_extraconf() function then it can contain additional config
+        # (Though this is awkward; sdk-extra.conf should probably be used instead)
         extraconf = (d.getVar('sdk_extraconf', True) or '').strip()
         if extraconf:
             # Strip off any leading / trailing spaces