Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
machine-overrides-extender.bbclass: Automatically set extend the MACH…
Browse files Browse the repository at this point in the history
…INEOVERRIDES

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 <[email protected]>
  • Loading branch information
otavio committed Sep 8, 2016
1 parent 44b83e7 commit c514a6b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions classes/machine-overrides-extender.bbclass
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c514a6b

Please sign in to comment.