aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2016-07-01 12:12:55 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2016-09-08 11:00:18 -0300
commitc514a6b3af51df169d911976c6cfaf9175c0eedf (patch)
treeeabfb952cfd65e4e2ec736664b616bc9f82514a5
parent44b83e714b5a04103788b6aa2242b0e4f93f22aa (diff)
downloadmeta-fsl-arm-c514a6b3af51df169d911976c6cfaf9175c0eedf.tar.gz
meta-fsl-arm-c514a6b3af51df169d911976c6cfaf9175c0eedf.tar.bz2
meta-fsl-arm-c514a6b3af51df169d911976c6cfaf9175c0eedf.zip
machine-overrides-extender.bbclass: Automatically set extend the MACHINEOVERRIDES
This allow to grouping of different settings for similar platforms. To use the class, specify, for example: MACHINEOVERRIDES_EXTENDER_soc = "group1:group2" Change-Id: I4a7dcd353b8bedf9d8f213827d7de768783c3d5d Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r--classes/machine-overrides-extender.bbclass29
1 files changed, 29 insertions, 0 deletions
diff --git a/classes/machine-overrides-extender.bbclass b/classes/machine-overrides-extender.bbclass
new file mode 100644
index 0000000..89ff99c
--- /dev/null
+++ b/classes/machine-overrides-extender.bbclass
@@ -0,0 +1,29 @@
+# -*- python -*-
+# Automatically set extend the MACHINEOVERRIDES
+#
+# This allow to grouping of different settings for similar platforms.
+#
+# To use the class, specify, for example:
+#
+# MACHINEOVERRIDES_EXTENDER_soc = "group1:group2"
+#
+# Copyright 2016 (C) O.S. Systems Software LTDA.
+
+def machine_overrides_extender(d):
+ machine_overrides = (d.getVar('MACHINEOVERRIDES', True) or '').split(':')
+ for o in machine_overrides:
+ extender = d.getVar('MACHINEOVERRIDES_EXTENDER_%s' % o, True)
+ if extender:
+ extender = extender.split(':')
+ extender.reverse()
+ if not set(extender).issubset(set(machine_overrides)):
+ index = machine_overrides.index(o)
+ for e in extender:
+ machine_overrides.insert(index, e)
+ d.setVar('MACHINEOVERRIDES', ':'.join(machine_overrides))
+
+python machine_overrides_extender_handler() {
+ machine_overrides_extender(e.data)
+}
+machine_overrides_extender_handler[eventmask] = "bb.event.ConfigParsed"
+addhandler machine_overrides_extender_handler