summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaewon Lee <jaewon.lee@xilinx.com>2018-08-09 16:41:29 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-14 11:36:31 +0100
commit97684b24b32584cd2dede2ce93b3d834b774d68a (patch)
tree3fc31e1b46ed595f7d78538c341b1cdafb390c8e
parent0472cc2368cc7beab8ee18ac4320868980406929 (diff)
downloadpoky-97684b24b32584cd2dede2ce93b3d834b774d68a.tar.gz
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] v2: also supporting patch not in SRC_URI v3: fix spacing issues (From OE-Core rev: 5dffd5403664dfcc9e8e42fd3581d5cb70823d7e) Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com> Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/devtool-source.bbclass12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/classes/devtool-source.bbclass b/meta/classes/devtool-source.bbclass
index 56882a41d8..67cd0bafb2 100644
--- a/meta/classes/devtool-source.bbclass
+++ b/meta/classes/devtool-source.bbclass
@@ -90,11 +90,23 @@ python devtool_post_unpack() {
90 fname in files]) 90 fname in files])
91 return ret 91 return ret
92 92
93 is_kernel_yocto = bb.data.inherits_class('kernel-yocto', d)
93 # Move local source files into separate subdir 94 # Move local source files into separate subdir
94 recipe_patches = [os.path.basename(patch) for patch in 95 recipe_patches = [os.path.basename(patch) for patch in
95 oe.recipeutils.get_recipe_patches(d)] 96 oe.recipeutils.get_recipe_patches(d)]
96 local_files = oe.recipeutils.get_recipe_local_files(d) 97 local_files = oe.recipeutils.get_recipe_local_files(d)
97 98
99 if is_kernel_yocto:
100 for key in local_files.copy():
101 if key.endswith('scc'):
102 sccfile = open(local_files[key], 'r')
103 for l in sccfile:
104 line = l.split()
105 if line and line[0] in ('kconf', 'patch'):
106 local_files[line[-1]] = os.path.join(os.path.dirname(local_files[key]), line[-1])
107 shutil.copy2(os.path.join(os.path.dirname(local_files[key]), line[-1]), workdir)
108 sccfile.close()
109
98 # Ignore local files with subdir={BP} 110 # Ignore local files with subdir={BP}
99 srcabspath = os.path.abspath(srcsubdir) 111 srcabspath = os.path.abspath(srcsubdir)
100 local_files = [fname for fname in local_files if 112 local_files = [fname for fname in local_files if