summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorWill Page <wpage@polysync.io>2019-09-12 15:02:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-30 16:44:42 +0100
commitc046ff7d090f99c9066e9abdafdee747b0d21f2e (patch)
treef0a2c38e0b28b6202c8d8b7f959f844810c87f41 /meta/classes
parenta58e84987d785cb31b80fc0785a890d154bda7d7 (diff)
downloadpoky-c046ff7d090f99c9066e9abdafdee747b0d21f2e.tar.gz
uboot: fixes to uboot-extlinux-config attribute values
The way this class uses overrides to support generation of multiple sections is subject to two different issues: 1) labels that conflict with existing override names causing the value for the conflicting label to be set for all labels, and 2) reusing the override list through each iteration, prepending each new label to the list of overrides makes earlier labels' value take precedence over later labels, making later labels virtually impossible to customize. The first issue is resolved by removing all label names from overrides before iterating over labels. The second issue is resolved by generating a fresh list of overrides with only the current label added. The current label is also appended to the list of overrides instead of prepended, which makes it the highest priority override. This is matches the behavior of devtool-source.bbclass, which similarly monkey-patches overrides. Closes https://bugzilla.yoctoproject.org/show_bug.cgi?id=13469 . (From OE-Core rev: 933a85e45c3edd65cdcc00cb18e17524e0411a09) Signed-off-by: Will Page <wpage@polysync.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/uboot-extlinux-config.bbclass13
1 files changed, 8 insertions, 5 deletions
diff --git a/meta/classes/uboot-extlinux-config.bbclass b/meta/classes/uboot-extlinux-config.bbclass
index b5b1a81dfc..f4bf94be04 100644
--- a/meta/classes/uboot-extlinux-config.bbclass
+++ b/meta/classes/uboot-extlinux-config.bbclass
@@ -104,13 +104,16 @@ python do_create_extlinux_config() {
104 if default: 104 if default:
105 cfgfile.write('DEFAULT %s\n' % (default)) 105 cfgfile.write('DEFAULT %s\n' % (default))
106 106
107 for label in labels.split(): 107 # Need to deconflict the labels with existing overrides
108 label_overrides = labels.split()
109 default_overrides = localdata.getVar('OVERRIDES').split(':')
110 # We're keeping all the existing overrides that aren't used as a label
111 # an override for that label will be added back in while we're processing that label
112 keep_overrides = list(filter(lambda x: x not in label_overrides, default_overrides))
108 113
109 overrides = localdata.getVar('OVERRIDES') 114 for label in labels.split():
110 if not overrides:
111 bb.fatal('OVERRIDES not defined')
112 115
113 localdata.setVar('OVERRIDES', label + ':' + overrides) 116 localdata.setVar('OVERRIDES', ':'.join(keep_overrides + [label]))
114 117
115 extlinux_console = localdata.getVar('UBOOT_EXTLINUX_CONSOLE') 118 extlinux_console = localdata.getVar('UBOOT_EXTLINUX_CONSOLE')
116 119