diff options
-rw-r--r-- | meta/classes-recipe/populate_sdk_ext.bbclass | 3 | ||||
-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 | ||||
-rwxr-xr-x | scripts/devtool | 17 |
5 files changed, 21 insertions, 9 deletions
diff --git a/meta/classes-recipe/populate_sdk_ext.bbclass b/meta/classes-recipe/populate_sdk_ext.bbclass index 01d8a693a7..f78a9f4e9b 100644 --- a/meta/classes-recipe/populate_sdk_ext.bbclass +++ b/meta/classes-recipe/populate_sdk_ext.bbclass | |||
@@ -255,7 +255,7 @@ python copy_buildsystem () { | |||
255 | bbpath = d.getVar('BBPATH') | 255 | bbpath = d.getVar('BBPATH') |
256 | env = os.environ.copy() | 256 | env = os.environ.copy() |
257 | env['PYTHONDONTWRITEBYTECODE'] = '1' | 257 | env['PYTHONDONTWRITEBYTECODE'] = '1' |
258 | bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--create-only', os.path.join(baseoutpath, 'workspace')], env=env) | 258 | bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--layerseries', d.getVar("LAYERSERIES_CORENAMES"), '--create-only', os.path.join(baseoutpath, 'workspace')], env=env) |
259 | 259 | ||
260 | # Create bblayers.conf | 260 | # Create bblayers.conf |
261 | bb.utils.mkdirhier(baseoutpath + '/conf') | 261 | bb.utils.mkdirhier(baseoutpath + '/conf') |
@@ -498,7 +498,6 @@ python copy_buildsystem () { | |||
498 | else: | 498 | else: |
499 | tasklistfn = None | 499 | tasklistfn = None |
500 | 500 | ||
501 | |||
502 | cachedir = os.path.join(baseoutpath, 'cache') | 501 | cachedir = os.path.join(baseoutpath, 'cache') |
503 | bb.utils.mkdirhier(cachedir) | 502 | bb.utils.mkdirhier(cachedir) |
504 | bb.parse.siggen.copy_unitaskhashes(cachedir) | 503 | bb.parse.siggen.copy_unitaskhashes(cachedir) |
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): |
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 | ||
144 | def _create_workspace(workspacedir, config, basepath): | 147 | def _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 | ||