diff options
author | Alexander Kanavin <alex@linutronix.de> | 2025-10-02 18:16:58 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-03 17:51:38 +0100 |
commit | 431e5ebf53327f32c9a84567b2bf4147ab64b9e3 (patch) | |
tree | 62c2d31898a6fdebc8bb1294a0b7fdc4a77ddb0d /meta/lib/bbconfigbuild/configfragments.py | |
parent | 7a3925c6e50d90b70e687c3c75ca3ab4c10cb245 (diff) | |
download | poky-431e5ebf53327f32c9a84567b2bf4147ab64b9e3.tar.gz |
lib/bbconfigbuild/configfragments: disable the previous builtin fragment when enabling a new one
There was a flaw in the logic that allowed multiple builtin fragments with
the same prefix to be enabled at the same time. The correct behaviour
is that only one of them should be enabled, and when enabling it
all previously enabled fragments should be removed.
The issues that this caused are further explained in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15987
[YOCTO #15987]
(From OE-Core rev: ada326e2070510fd018a6df3ce686fdce52517d2)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/bbconfigbuild/configfragments.py')
-rw-r--r-- | meta/lib/bbconfigbuild/configfragments.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/lib/bbconfigbuild/configfragments.py b/meta/lib/bbconfigbuild/configfragments.py index 452e418c38..fec985b442 100644 --- a/meta/lib/bbconfigbuild/configfragments.py +++ b/meta/lib/bbconfigbuild/configfragments.py | |||
@@ -104,8 +104,11 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
104 | return True | 104 | return True |
105 | return False | 105 | return False |
106 | 106 | ||
107 | def fragment_prefix(self, fragmentname): | ||
108 | return fragmentname.split("/",1)[0] | ||
109 | |||
107 | def builtin_fragment_exists(self, fragmentname): | 110 | def builtin_fragment_exists(self, fragmentname): |
108 | fragment_prefix = fragmentname.split("/",1)[0] | 111 | fragment_prefix = self.fragment_prefix(fragmentname) |
109 | fragment_prefix_defs = set([f.split(':')[0] for f in self.tinfoil.config_data.getVar('OE_FRAGMENTS_BUILTIN').split()]) | 112 | fragment_prefix_defs = set([f.split(':')[0] for f in self.tinfoil.config_data.getVar('OE_FRAGMENTS_BUILTIN').split()]) |
110 | return fragment_prefix in fragment_prefix_defs | 113 | return fragment_prefix in fragment_prefix_defs |
111 | 114 | ||
@@ -128,6 +131,8 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
128 | if f in enabled_fragments: | 131 | if f in enabled_fragments: |
129 | print("Fragment {} already included in {}".format(f, args.confpath)) | 132 | print("Fragment {} already included in {}".format(f, args.confpath)) |
130 | else: | 133 | else: |
134 | # first filter out all built-in fragments with the same prefix as the one that is being enabled | ||
135 | enabled_fragments = [fragment for fragment in enabled_fragments if not(self.builtin_fragment_exists(fragment) and self.fragment_prefix(fragment) == self.fragment_prefix(f))] | ||
131 | enabled_fragments.append(f) | 136 | enabled_fragments.append(f) |
132 | return " ".join(enabled_fragments), None, 0, True | 137 | return " ".join(enabled_fragments), None, 0, True |
133 | 138 | ||