]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: Support kmeta directory usage with devtool modify/finish
authorJaewon Lee <jaewon.lee@xilinx.com>
Sat, 15 Dec 2018 00:39:22 +0000 (16:39 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Mar 2019 22:27:22 +0000 (22:27 +0000)
When using Kmeta directories, devtool finish will add every single file
in the directory to the bbappend. This is because in the current
implementation, the get_recipe_local_files function treats the kmeta
directory like a file. Modifying the function to loop through the
provided directories and return all included files instead of just the
top level directory. This will enable correct file to file comparison
when determing which files are new/changed and need to be added to the
bbappend.

Adding an extra check in devtool-source.bbclass to not copy the cfg file
if its already included somewhere in the kmeta directory

Also during 'modify', when moving necessary files in the kmeta directory
from the workdir to oe-local-files, the dangling parent directories are
left behind.  This in itself is not an issue as the temporary devtool
workspace is automatically deleted, but this causes an incorrect include
directory to be added in kernel-yocto.bbclass.  Changing the order of
the if statements to catch the correct conditional. This is safe to do
as when not in the devtool context, there will be no oe-local-files
directory.

Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com>
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
Acked-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/devtool-source.bbclass
meta/classes/kernel-yocto.bbclass
meta/lib/oe/recipeutils.py

index 1372e32c9e5dec1516d54717e1a3b006e7f2302e..a8110006fbc0c1f4cf8226f7ccce192b8fe75aaa 100644 (file)
@@ -103,8 +103,10 @@ python devtool_post_unpack() {
                 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)
+                        cfg = os.path.join(os.path.dirname(local_files[key]), line[-1])
+                        if not cfg in local_files.values():
+                            local_files[line[-1]] = cfg
+                            shutil.copy2(cfg, workdir)
                 sccfile.close()
 
     # Ignore local files with subdir={BP}
index 496c8a7f68e790a58ca6dbf468b4e9d2f721e84d..2f556ca03b206ad7fb57ff4dd29d4a1daca9e383 100644 (file)
@@ -138,10 +138,10 @@ do_kernel_metadata() {
        for f in ${feat_dirs}; do
                if [ -d "${WORKDIR}/$f/meta" ]; then
                        includes="$includes -I${WORKDIR}/$f/kernel-meta"
-               elif [ -d "${WORKDIR}/$f" ]; then
-                       includes="$includes -I${WORKDIR}/$f"
                elif [ -d "${WORKDIR}/../oe-local-files/$f" ]; then
                        includes="$includes -I${WORKDIR}/../oe-local-files/$f"
+               elif [ -d "${WORKDIR}/$f" ]; then
+                       includes="$includes -I${WORKDIR}/$f"
                fi
        done
        for s in ${sccs} ${patches}; do
index 8f70d2eb2127219a7c0fdb57b535da188fc5b328..4ca200d83441f21b480b40ec1eeafdb2bce488cc 100644 (file)
@@ -482,7 +482,14 @@ def get_recipe_local_files(d, patches=False, archives=False):
                     unpack = fetch.ud[uri].parm.get('unpack', True)
                     if unpack:
                         continue
-            ret[fname] = localpath
+            if os.path.isdir(localpath):
+                for root, dirs, files in os.walk(localpath):
+                    for fname in files:
+                        fileabspath = os.path.join(root,fname)
+                        srcdir = os.path.dirname(localpath)
+                        ret[os.path.relpath(fileabspath,srcdir)] = fileabspath
+            else:
+                ret[fname] = localpath
     return ret