devtool-source.bbclass: Support kernel-fragments/patch not in SRC_URI
PATCH v2 1/1 devtool-source.bbclass: Support kernel-fragments/patch not in SRC_URI
When using a recipe space kernel-meta, scc files are added through SRC_URI, but they may include corresponding kernel fragments or patches that are not necessarily in SRC_URI.
For bitbake, this is not a problem because the kernel-yocto class adds the path where the .scc file was found to includes which consequentially makes the .cfg, .patch file available to the kernel build.
However, when using devtool, only files specified in SRC_URI are copied to oe-local-files in devtool's workspace. So if the cfg/patch file is not in SRC_URI, it won't be copied, causing a kernel build failure when trying to find it.
This fix parses local .scc files in SRC_URI, copies the corresponding .cfg/.patch file to devtool's workdir, and also adds it to local_files so it is available when doing a devtool build for the kernel.
[YOCTO #12858]
--- meta/classes/devtool-source.bbclass | 12 ++++++++++++ 1 file changed, 12 insertions(+)
meta/classes/devtool-source.bbclass +12 -0
@@ -90,11 +90,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 local_files.copy(): + if key.endswith('scc'): + sccfile = open(local_files[key], 'r') + for l in sccfile: + line = l.split() + if line and line[0] in ('kconf', 'patch'): + local_files[line[-1]] = os.path.join(os.path.dirname(local_files[key]), line[-1]) + shutil.copy2(os.path.join(os.path.dirname(local_files[key]), line[-1]), workdir) + sccfile.close() + # Ignore local files with subdir={BP} srcabspath = os.path.abspath(srcsubdir) local_files = [fname for fname in local_files if
Signature · 1 line
2.7.4
Quoted 39 lines · Jaewon Lee
When using a recipe space kernel-meta, scc files are added through
SRC_URI, but they may include corresponding kernel fragments or patches that are not necessarily inSRC_URI.For bitbake, this is not a problem because the kernel-yocto class adds the path where the .scc file was found to includes which consequentially makes the .cfg, .patch file available to the kernel build.
However, when using devtool, only files specified in
SRC_URIare copied to oe-local-files in devtool's workspace. So if the cfg/patch file is not inSRC_URI, it won't be copied, causing a kernel build failure when trying to find it.This fix parses local .scc files in
SRC_URI, copies the corresponding .cfg/.patch file to devtool's workdir, and also adds it tolocal_filesso it is available when doing a devtool build for the kernel.[YOCTO #12858]
Signed-off-by Jaewon Lee <[email protected]>--- meta/classes/devtool-source.bbclass | 12 ++++++++++++ 1 file changed, 12 insertions(+)meta/classes/devtool-source.bbclass +1
-0@@ -90,11 +90,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)
meta/classes/devtool-source.bbclass python devtool_post_unpack() { · line 108
Quoted 10 lines
meta/classes/devtool-source.bbclass +10
-0+ if is_kernel_yocto: + for key in local_files.copy(): + if key.endswith('scc'): + sccfile = open(local_files[key], 'r') + for l in sccfile: + line = l.split() + if line and line[0] in ('kconf', 'patch'): + local_files[line[-1]] = os.path.join(os.path.dirname(local_files[key]), line[-1]) + shutil.copy2(os.path.join(os.path.dirname(local_files[key]), line[-1]), workdir) + sccfile.close()
You're using two space indentation here but the rest of our code and our style guide says we use 4 spaces. Could you fix that please?
Its also handy to mention what changed between v1 and v2.
Cheers,
Richard