diff options
Diffstat (limited to 'meta/classes/devtool-source.bbclass')
-rw-r--r-- | meta/classes/devtool-source.bbclass | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/meta/classes/devtool-source.bbclass b/meta/classes/devtool-source.bbclass index 56882a41d8..4158c20c7e 100644 --- a/meta/classes/devtool-source.bbclass +++ b/meta/classes/devtool-source.bbclass @@ -1,3 +1,9 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + # Development tool - source extraction helper class # # NOTE: this class is intended for use by devtool and should not be @@ -90,11 +96,23 @@ python devtool_post_unpack() { fname in files]) return ret + is_kernel_yocto = bb.data.inherits_class('kernel-yocto', d) # Move local source files into separate subdir recipe_patches = [os.path.basename(patch) for patch in oe.recipeutils.get_recipe_patches(d)] local_files = oe.recipeutils.get_recipe_local_files(d) + if is_kernel_yocto: + for key in [f for f in local_files if f.endswith('scc')]: + with open(local_files[key], 'r') as sccfile: + for l in sccfile: + line = l.split() + if line and line[0] in ('kconf', 'patch'): + cfg = os.path.join(os.path.dirname(local_files[key]), line[-1]) + if cfg not in local_files.values(): + local_files[line[-1]] = cfg + shutil.copy2(cfg, workdir) + # Ignore local files with subdir={BP} srcabspath = os.path.abspath(srcsubdir) local_files = [fname for fname in local_files if @@ -171,14 +189,14 @@ python devtool_post_patch() { extra_overrides = d.getVar('DEVTOOL_EXTRA_OVERRIDES') if extra_overrides: - extra_override_list = extra_overrides.split(':') + extra_overrides = set(extra_overrides.split(':')) devbranch = d.getVar('DEVTOOL_DEVBRANCH') default_overrides = d.getVar('OVERRIDES').split(':') no_overrides = [] # First, we may have some overrides that are referred to in the recipe set in # our configuration, so we need to make a branch that excludes those for override in default_overrides: - if override not in extra_override_list: + if override not in extra_overrides: no_overrides.append(override) if default_overrides != no_overrides: # Some overrides are active in the current configuration, so @@ -187,6 +205,7 @@ python devtool_post_patch() { # Run do_patch function with the override applied localdata = bb.data.createCopy(d) localdata.setVar('OVERRIDES', ':'.join(no_overrides)) + localdata.setVar('FILESOVERRIDES', ':'.join(no_overrides)) bb.build.exec_func('do_patch', localdata) rm_patches() # Now we need to reconcile the dev branch with the no-overrides one @@ -196,7 +215,7 @@ python devtool_post_patch() { else: bb.process.run('git checkout %s -b devtool-no-overrides' % devbranch, cwd=srcsubdir) - for override in extra_override_list: + for override in extra_overrides: localdata = bb.data.createCopy(d) if override in default_overrides: bb.process.run('git branch devtool-override-%s %s' % (override, devbranch), cwd=srcsubdir) @@ -204,7 +223,8 @@ python devtool_post_patch() { # Reset back to the initial commit on a new branch bb.process.run('git checkout %s -b devtool-override-%s' % (initial_rev, override), cwd=srcsubdir) # Run do_patch function with the override applied - localdata.appendVar('OVERRIDES', ':%s' % override) + localdata.setVar('OVERRIDES', ':'.join(no_overrides + [override])) + localdata.setVar('FILESOVERRIDES', ':'.join(no_overrides + [override])) bb.build.exec_func('do_patch', localdata) rm_patches() # Now we need to reconcile the new branch with the no-overrides one @@ -212,6 +232,9 @@ python devtool_post_patch() { bb.process.run('git rebase devtool-no-overrides', cwd=srcsubdir) bb.process.run('git checkout %s' % devbranch, cwd=srcsubdir) bb.process.run('git tag -f devtool-patched', cwd=srcsubdir) + if os.path.exists(os.path.join(srcsubdir, '.gitmodules')): + bb.process.run('git submodule foreach --recursive "git tag -f devtool-patched"', cwd=srcsubdir) + } python devtool_post_configure() { |