summaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-09-20 16:43:33 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-04 17:23:58 +0000
commite36cf9e62190a4bdd7aa7aceff78446938f1540f (patch)
tree23e94e394b9ecc2252c93c1a93841620ab9333bb /scripts/lib/recipetool
parent611e4b43d8c9ba361805beb6e69147adf57f558f (diff)
downloadpoky-e36cf9e62190a4bdd7aa7aceff78446938f1540f.tar.gz
recipetool: ignore incidental kernel module source
If the source tree happens to contain a kernel module as an example, a test or under a "contrib" directory then we shouldn't be picking it up and making the determination that the entire thing is a kernel module. An example that triggered this is zstd, which ships a kernel module under contrib/linux-kernel: https://github.com/facebook/zstd (From OE-Core rev: 5c89bd0db1b327483f674802740ff21b909e0876) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool')
-rw-r--r--scripts/lib/recipetool/create.py6
-rw-r--r--scripts/lib/recipetool/create_kmod.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 1532735ab8..055bdef436 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -156,10 +156,12 @@ class RecipeHandler(object):
156 RecipeHandler.recipebinmap[prog] = pn 156 RecipeHandler.recipebinmap[prog] = pn
157 157
158 @staticmethod 158 @staticmethod
159 def checkfiles(path, speclist, recursive=False): 159 def checkfiles(path, speclist, recursive=False, excludedirs=None):
160 results = [] 160 results = []
161 if recursive: 161 if recursive:
162 for root, _, files in os.walk(path): 162 for root, dirs, files in os.walk(path, topdown=True):
163 if excludedirs:
164 dirs[:] = [d for d in dirs if d not in excludedirs]
163 for fn in files: 165 for fn in files:
164 for spec in speclist: 166 for spec in speclist:
165 if fnmatch.fnmatch(fn, spec): 167 if fnmatch.fnmatch(fn, spec):
diff --git a/scripts/lib/recipetool/create_kmod.py b/scripts/lib/recipetool/create_kmod.py
index 7cf188db21..4569b53c80 100644
--- a/scripts/lib/recipetool/create_kmod.py
+++ b/scripts/lib/recipetool/create_kmod.py
@@ -40,7 +40,7 @@ class KernelModuleRecipeHandler(RecipeHandler):
40 40
41 makefiles = [] 41 makefiles = []
42 42
43 files = RecipeHandler.checkfiles(srctree, ['*.c', '*.h'], recursive=True) 43 files = RecipeHandler.checkfiles(srctree, ['*.c', '*.h'], recursive=True, excludedirs=['contrib', 'test', 'examples'])
44 if files: 44 if files:
45 for cfile in files: 45 for cfile in files:
46 # Look in same dir or parent for Makefile 46 # Look in same dir or parent for Makefile