diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-01 17:11:07 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-08 11:15:47 +0000 |
commit | 4d19594b8bdacde6d809d3f2a25cff7c5a42295e (patch) | |
tree | 21396fcd2514f14ac4db34e1db7ab5d85d76d822 /meta/lib | |
parent | 4901c9d471cab99d52876842980222ce271b66e4 (diff) | |
download | poky-4d19594b8bdacde6d809d3f2a25cff7c5a42295e.tar.gz |
devtool/friends: Use LAYERSERIES_CORENAMES when generating LAYERSERIES_COMPAT entries4.2_M1
It seems some layers want to subvert the intent of LAYERSERIES_COMPAT
so bitbake is going to have to become stricter about the values there.
To work with this, use LAYERSERIES_CORENAMES to generate the entries in
LAYERSERIES_COMPAT instead of the current magic LAYERSERIES_COMPAT_core
value which may not continue to work.
The downside to this is when migating between releases, people would
need to update devtool workspace layer.conf files. I guess you could
argue this is a feature!
(From OE-Core rev: 96ff9baa8ead57504f40f362ed3a4aaa776d1b58)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/bblayers/create.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 5 | ||||
-rw-r--r-- | meta/lib/oeqa/utils/commands.py | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/meta/lib/bblayers/create.py b/meta/lib/bblayers/create.py index 0aeb5d5f7b..c8f3f1b370 100644 --- a/meta/lib/bblayers/create.py +++ b/meta/lib/bblayers/create.py | |||
@@ -53,7 +53,7 @@ class CreatePlugin(LayerPlugin): | |||
53 | shutil.copy(license_src, license_dst) | 53 | shutil.copy(license_src, license_dst) |
54 | 54 | ||
55 | # Get the compat value for core layer. | 55 | # Get the compat value for core layer. |
56 | compat = self.tinfoil.config_data.getVar('LAYERSERIES_COMPAT_core') or "" | 56 | compat = self.tinfoil.config_data.getVar('LAYERSERIES_CORENAMES') or "" |
57 | 57 | ||
58 | # Create the layer.conf from templates/layer.conf | 58 | # Create the layer.conf from templates/layer.conf |
59 | layerconf_template = read_template('layer.conf').format( | 59 | layerconf_template = read_template('layer.conf').format( |
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 0cb7403f16..c78a68be5b 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -1076,9 +1076,10 @@ class DevtoolUpdateTests(DevtoolBase): | |||
1076 | def test_devtool_update_recipe_append_git(self): | 1076 | def test_devtool_update_recipe_append_git(self): |
1077 | # Check preconditions | 1077 | # Check preconditions |
1078 | testrecipe = 'mtd-utils-selftest' | 1078 | testrecipe = 'mtd-utils-selftest' |
1079 | bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe) | 1079 | bb_vars = get_bb_vars(['FILE', 'SRC_URI', 'LAYERSERIES_CORENAMES'], testrecipe) |
1080 | recipefile = bb_vars['FILE'] | 1080 | recipefile = bb_vars['FILE'] |
1081 | src_uri = bb_vars['SRC_URI'] | 1081 | src_uri = bb_vars['SRC_URI'] |
1082 | corenames = bb_vars['LAYERSERIES_CORENAMES'] | ||
1082 | self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe) | 1083 | self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe) |
1083 | for entry in src_uri.split(): | 1084 | for entry in src_uri.split(): |
1084 | if entry.startswith('git://'): | 1085 | if entry.startswith('git://'): |
@@ -1109,7 +1110,7 @@ class DevtoolUpdateTests(DevtoolBase): | |||
1109 | f.write('BBFILE_PATTERN_oeselftesttemplayer = "^${LAYERDIR}/"\n') | 1110 | f.write('BBFILE_PATTERN_oeselftesttemplayer = "^${LAYERDIR}/"\n') |
1110 | f.write('BBFILE_PRIORITY_oeselftesttemplayer = "999"\n') | 1111 | f.write('BBFILE_PRIORITY_oeselftesttemplayer = "999"\n') |
1111 | f.write('BBFILE_PATTERN_IGNORE_EMPTY_oeselftesttemplayer = "1"\n') | 1112 | f.write('BBFILE_PATTERN_IGNORE_EMPTY_oeselftesttemplayer = "1"\n') |
1112 | f.write('LAYERSERIES_COMPAT_oeselftesttemplayer = "${LAYERSERIES_COMPAT_core}"\n') | 1113 | f.write('LAYERSERIES_COMPAT_oeselftesttemplayer = "%s"\n' % corenames) |
1113 | self.add_command_to_tearDown('bitbake-layers remove-layer %s || true' % templayerdir) | 1114 | self.add_command_to_tearDown('bitbake-layers remove-layer %s || true' % templayerdir) |
1114 | result = runCmd('bitbake-layers add-layer %s' % templayerdir, cwd=self.builddir) | 1115 | result = runCmd('bitbake-layers add-layer %s' % templayerdir, cwd=self.builddir) |
1115 | # Create the bbappend | 1116 | # Create the bbappend |
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index f733fcdf3c..f4daea2507 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py | |||
@@ -300,6 +300,7 @@ def get_test_layer(): | |||
300 | 300 | ||
301 | def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec='recipes-*/*'): | 301 | def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec='recipes-*/*'): |
302 | os.makedirs(os.path.join(templayerdir, 'conf')) | 302 | os.makedirs(os.path.join(templayerdir, 'conf')) |
303 | corenames = get_bb_var('LAYERSERIES_CORENAMES') | ||
303 | with open(os.path.join(templayerdir, 'conf', 'layer.conf'), 'w') as f: | 304 | with open(os.path.join(templayerdir, 'conf', 'layer.conf'), 'w') as f: |
304 | f.write('BBPATH .= ":${LAYERDIR}"\n') | 305 | f.write('BBPATH .= ":${LAYERDIR}"\n') |
305 | f.write('BBFILES += "${LAYERDIR}/%s/*.bb \\' % recipepathspec) | 306 | f.write('BBFILES += "${LAYERDIR}/%s/*.bb \\' % recipepathspec) |
@@ -308,7 +309,7 @@ def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec= | |||
308 | f.write('BBFILE_PATTERN_%s = "^${LAYERDIR}/"\n' % templayername) | 309 | f.write('BBFILE_PATTERN_%s = "^${LAYERDIR}/"\n' % templayername) |
309 | f.write('BBFILE_PRIORITY_%s = "%d"\n' % (templayername, priority)) | 310 | f.write('BBFILE_PRIORITY_%s = "%d"\n' % (templayername, priority)) |
310 | f.write('BBFILE_PATTERN_IGNORE_EMPTY_%s = "1"\n' % templayername) | 311 | f.write('BBFILE_PATTERN_IGNORE_EMPTY_%s = "1"\n' % templayername) |
311 | f.write('LAYERSERIES_COMPAT_%s = "${LAYERSERIES_COMPAT_core}"\n' % templayername) | 312 | f.write('LAYERSERIES_COMPAT_%s = "%s"\n' % (templayername, corenames)) |
312 | 313 | ||
313 | @contextlib.contextmanager | 314 | @contextlib.contextmanager |
314 | def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, qemuparams=None, overrides={}, discard_writes=True): | 315 | def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, qemuparams=None, overrides={}, discard_writes=True): |