diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2018-07-02 20:24:11 -0300 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2018-07-03 09:17:52 -0300 |
commit | d227cc133101ecbce25fc4f775863107537f883d (patch) | |
tree | 56d6b498e321bee61596d9d1ec8e14801f7855ef /classes | |
parent | a27acfd6d0d3700e2dfe22099cce3d3dae12045a (diff) | |
download | meta-freescale-d227cc133101ecbce25fc4f775863107537f883d.tar.gz |
machine-overrides-extender.bbclass: Postpone overrides processing
We need to keep a reference to the original MACHINEOVERRIDES value so
it can be reprocessed as need. This allow the compatibility with
existing BSP's while fixing the complex multilib interactions.
I'd like to record that Richard Purdie was key to solve this issue.
Its implications were beyond my understanding until he guided me and
provided a prototype fix.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'classes')
-rw-r--r-- | classes/machine-overrides-extender.bbclass | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/classes/machine-overrides-extender.bbclass b/classes/machine-overrides-extender.bbclass index 6c2ec32e..7aaae858 100644 --- a/classes/machine-overrides-extender.bbclass +++ b/classes/machine-overrides-extender.bbclass | |||
@@ -12,14 +12,10 @@ | |||
12 | # | 12 | # |
13 | # MACHINEOVERRIDES_EXTENDER_FILTER_OUT_override = "group1 group2" | 13 | # MACHINEOVERRIDES_EXTENDER_FILTER_OUT_override = "group1 group2" |
14 | # | 14 | # |
15 | # Copyright 2016-2017 (C) O.S. Systems Software LTDA. | 15 | # Copyright 2016-2018 (C) O.S. Systems Software LTDA. |
16 | 16 | ||
17 | def machine_overrides_extender(d): | 17 | def machine_overrides_extender(d): |
18 | variant = d.getVar("BBEXTENDVARIANT") | 18 | machine_overrides = (d.getVar('PRISTINE_MACHINEOVERRIDES', True) or '').split(':') |
19 | if variant: | ||
20 | return | ||
21 | |||
22 | machine_overrides = (d.getVar('MACHINEOVERRIDES', True) or '').split(':') | ||
23 | 19 | ||
24 | # Gather the list of overrides to filter out | 20 | # Gather the list of overrides to filter out |
25 | machine_overrides_filter_out = [] | 21 | machine_overrides_filter_out = [] |
@@ -43,11 +39,18 @@ def machine_overrides_extender(d): | |||
43 | index = machine_overrides.index(override) | 39 | index = machine_overrides.index(override) |
44 | for e in extender: | 40 | for e in extender: |
45 | machine_overrides.insert(index, e) | 41 | machine_overrides.insert(index, e) |
46 | d.setVar('MACHINEOVERRIDES', ':'.join(machine_overrides)) | 42 | |
43 | return ':'.join(machine_overrides) | ||
47 | 44 | ||
48 | python machine_overrides_extender_handler() { | 45 | python machine_overrides_extender_handler() { |
49 | machine_overrides_extender(e.data) | 46 | # Ideally we'd use a separate variable name for this however |
47 | # historically NXP BSPs used this. We save it to a known good name | ||
48 | # so we can reprocess OVERRIDES if/as/when needed. | ||
49 | d.renameVar("MACHINEOVERRIDES", "PRISTINE_MACHINEOVERRIDES") | ||
50 | |||
51 | # Now we add our own function intercept in instead | ||
52 | d.setVar("MACHINEOVERRIDES", "${@machine_overrides_extender(d)}:") | ||
50 | } | 53 | } |
51 | 54 | ||
52 | machine_overrides_extender_handler[eventmask] = "bb.event.RecipePreFinalise" | 55 | machine_overrides_extender_handler[eventmask] = "bb.event.ConfigParsed" |
53 | addhandler machine_overrides_extender_handler | 56 | addhandler machine_overrides_extender_handler |