[OE-core] [PATCH 2/2] populate_sdk_ext: add option to append lines into local.conf

Andrej Valek andrej.valek at siemens.com
Fri Mar 6 15:32:34 UTC 2020


Add option to add new lines into local.conf content in ext_sdk case
via SDK_LOCAL_CONF_EXTRALIST variable.

Signed-off-by: Andrej Valek <andrej.valek at siemens.com>
---
 meta/classes/buildhistory.bbclass     |  4 ++--
 meta/classes/populate_sdk_ext.bbclass | 12 +++++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index eb7295570d..a347811edc 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -757,8 +757,8 @@ def buildhistory_get_sdkvars(d):
     sdkvars = "DISTRO DISTRO_VERSION SDK_NAME SDK_VERSION SDKMACHINE SDKIMAGE_FEATURES BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE"
     if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext':
         # Extensible SDK uses some additional variables
-        sdkvars += " SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST SDK_UPDATE_URL SDK_EXT_TYPE SDK_RECRDEP_TASKS SDK_INCLUDE_PKGDATA SDK_INCLUDE_TOOLCHAIN"
-    listvars = "SDKIMAGE_FEATURES BAD_RECOMMENDATIONS PACKAGE_EXCLUDE SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST"
+        sdkvars += " SDK_LOCAL_CONF_EXTRALIST SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST SDK_UPDATE_URL SDK_EXT_TYPE SDK_RECRDEP_TASKS SDK_INCLUDE_PKGDATA SDK_INCLUDE_TOOLCHAIN"
+    listvars = "SDKIMAGE_FEATURES BAD_RECOMMENDATIONS PACKAGE_EXCLUDE SDK_LOCAL_CONF_EXTRALIST SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST"
     return outputvars(sdkvars, listvars, d)
 
 
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index 9f26cfc131..2eccf52df1 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -25,6 +25,7 @@ SDK_INCLUDE_BUILDTOOLS ?= '1'
 
 SDK_RECRDEP_TASKS ?= ""
 
+SDK_LOCAL_CONF_EXTRALIST ?= ""
 SDK_LOCAL_CONF_WHITELIST ?= ""
 SDK_LOCAL_CONF_BLACKLIST ?= "CONF_VERSION \
                              BB_NUMBER_THREADS \
@@ -372,7 +373,16 @@ python copy_buildsystem () {
                     for line in xf:
                         f.write(line)
 
-            # If you define a sdk_extraconf() function then it can contain additional config
+            # Allow additional config through SDK_LOCAL_CONF_EXTRALIST
+            local_conf_extralist = (d.getVar('SDK_LOCAL_CONF_EXTRALIST') or '').split()
+            if local_conf_extralist:
+                for var in local_conf_extralist:
+                    value = d.getVar(var) or ""
+                    if value:
+                        f.write('%s = "%s"\n' % (var, value))
+                f.write('\n')
+
+            # If you define a sdk_extraconf variable then it can contain additional config
             # (Though this is awkward; sdk-extra.conf should probably be used instead)
             extraconf = (d.getVar('sdk_extraconf') or '').strip()
             if extraconf:
-- 
2.11.0



More information about the Openembedded-core mailing list