summaryrefslogtreecommitdiffstats
path: root/meta/lib/bbconfigbuild/configfragments.py
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-10-02 18:16:58 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-04 11:16:44 +0100
commitaeb0078d5dc03bde4d3ae3693bf01250f8fb91f4 (patch)
treeada46d5add9bbb4ef788c2d1c60f1490e8af1c00 /meta/lib/bbconfigbuild/configfragments.py
parent69f24b64121db6347ad8658cfdb5108c03c301d8 (diff)
downloadpoky-aeb0078d5dc03bde4d3ae3693bf01250f8fb91f4.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: 4cc78af26d8c3154d4f2b3b37d8e4dc65485eb66) 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.py7
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