summaryrefslogtreecommitdiffstats
path: root/scripts/devtool
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-01 17:11:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-08 11:15:47 +0000
commit4d19594b8bdacde6d809d3f2a25cff7c5a42295e (patch)
tree21396fcd2514f14ac4db34e1db7ab5d85d76d822 /scripts/devtool
parent4901c9d471cab99d52876842980222ce271b66e4 (diff)
downloadpoky-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 'scripts/devtool')
-rwxr-xr-xscripts/devtool17
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/devtool b/scripts/devtool
index 20d785c7f7..3aae7b93b4 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -137,17 +137,27 @@ def create_workspace(args, config, basepath, workspace):
137 workspacedir = os.path.abspath(args.layerpath) 137 workspacedir = os.path.abspath(args.layerpath)
138 else: 138 else:
139 workspacedir = os.path.abspath(os.path.join(basepath, 'workspace')) 139 workspacedir = os.path.abspath(os.path.join(basepath, 'workspace'))
140 _create_workspace(workspacedir, config, basepath) 140 layerseries = None
141 if args.layerseries:
142 layerseries = args.layerseries
143 _create_workspace(workspacedir, config, basepath, layerseries)
141 if not args.create_only: 144 if not args.create_only:
142 _enable_workspace_layer(workspacedir, config, basepath) 145 _enable_workspace_layer(workspacedir, config, basepath)
143 146
144def _create_workspace(workspacedir, config, basepath): 147def _create_workspace(workspacedir, config, basepath, layerseries=None):
145 import bb 148 import bb
146 149
147 confdir = os.path.join(workspacedir, 'conf') 150 confdir = os.path.join(workspacedir, 'conf')
148 if os.path.exists(os.path.join(confdir, 'layer.conf')): 151 if os.path.exists(os.path.join(confdir, 'layer.conf')):
149 logger.info('Specified workspace already set up, leaving as-is') 152 logger.info('Specified workspace already set up, leaving as-is')
150 else: 153 else:
154 if not layerseries:
155 tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
156 try:
157 layerseries = tinfoil.config_data.getVar('LAYERSERIES_CORENAMES')
158 finally:
159 tinfoil.shutdown()
160
151 # Add a config file 161 # Add a config file
152 bb.utils.mkdirhier(confdir) 162 bb.utils.mkdirhier(confdir)
153 with open(os.path.join(confdir, 'layer.conf'), 'w') as f: 163 with open(os.path.join(confdir, 'layer.conf'), 'w') as f:
@@ -159,7 +169,7 @@ def _create_workspace(workspacedir, config, basepath):
159 f.write('BBFILE_PATTERN_workspacelayer = "^$' + '{LAYERDIR}/"\n') 169 f.write('BBFILE_PATTERN_workspacelayer = "^$' + '{LAYERDIR}/"\n')
160 f.write('BBFILE_PATTERN_IGNORE_EMPTY_workspacelayer = "1"\n') 170 f.write('BBFILE_PATTERN_IGNORE_EMPTY_workspacelayer = "1"\n')
161 f.write('BBFILE_PRIORITY_workspacelayer = "99"\n') 171 f.write('BBFILE_PRIORITY_workspacelayer = "99"\n')
162 f.write('LAYERSERIES_COMPAT_workspacelayer = "${LAYERSERIES_COMPAT_core}"\n') 172 f.write('LAYERSERIES_COMPAT_workspacelayer = "%s"\n' % layerseries)
163 # Add a README file 173 # Add a README file
164 with open(os.path.join(workspacedir, 'README'), 'w') as f: 174 with open(os.path.join(workspacedir, 'README'), 'w') as f:
165 f.write('This layer was created by the OpenEmbedded devtool utility in order to\n') 175 f.write('This layer was created by the OpenEmbedded devtool utility in order to\n')
@@ -309,6 +319,7 @@ def main():
309 description='Sets up a new workspace. NOTE: other devtool subcommands will create a workspace automatically as needed, so you only need to use %(prog)s if you want to specify where the workspace should be located.', 319 description='Sets up a new workspace. NOTE: other devtool subcommands will create a workspace automatically as needed, so you only need to use %(prog)s if you want to specify where the workspace should be located.',
310 group='advanced') 320 group='advanced')
311 parser_create_workspace.add_argument('layerpath', nargs='?', help='Path in which the workspace layer should be created') 321 parser_create_workspace.add_argument('layerpath', nargs='?', help='Path in which the workspace layer should be created')
322 parser_create_workspace.add_argument('--layerseries', help='Layer series the workspace should be set to be compatible with')
312 parser_create_workspace.add_argument('--create-only', action="store_true", help='Only create the workspace layer, do not alter configuration') 323 parser_create_workspace.add_argument('--create-only', action="store_true", help='Only create the workspace layer, do not alter configuration')
313 parser_create_workspace.set_defaults(func=create_workspace, no_workspace=True) 324 parser_create_workspace.set_defaults(func=create_workspace, no_workspace=True)
314 325