diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-04-29 11:31:28 +0200 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2014-05-01 18:44:14 -0700 |
commit | 9262ad513b02f99f097d8e9808fcb18c1f611b26 (patch) | |
tree | c476f74ae5b9bc5362dfca7e7e9f9d2c014933ed | |
parent | 881c045f4d0f002555fb44ccda8829e67a4797db (diff) |
gentree: strip useless defconfig files
If a defconfig file has symbols that can't be satisfied
with the given copy-list file, then there's no point in
shipping it, so just copy selectively the ones needed.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
-rwxr-xr-x | gentree.py | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -581,7 +581,7 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None, # do the copy backport_files = [(x, x) for x in [ 'Kconfig', 'Makefile', 'Makefile.build', 'Makefile.kernel', '.gitignore', - 'Makefile.real', 'compat/', 'backport-include/', 'kconf/', 'defconfigs/', + 'Makefile.real', 'compat/', 'backport-include/', 'kconf/', 'scripts/', '.blacklist.map', ]] if not args.git_revision: @@ -785,6 +785,29 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None, git_debug_snapshot(args, "add versions/symbols files") + # add defconfigs that we want + defconfigs_dir = os.path.join(source_dir, 'backport', 'defconfigs') + os.mkdir(os.path.join(args.outdir, 'defconfigs')) + for dfbase in os.listdir(defconfigs_dir): + copy_defconfig = True + dfsrc = os.path.join(defconfigs_dir, dfbase) + for line in open(dfsrc, 'r'): + if not '=' in line: + continue + line_ok = False + for sym in symbols: + if sym + '=' in line: + line_ok = True + break + if not line_ok: + print dfbase, line + copy_defconfig = False + break + if copy_defconfig: + shutil.copy(dfsrc, os.path.join(args.outdir, 'defconfigs', dfbase)) + + git_debug_snapshot(args, "add (useful) defconfig files") + logwrite('Rewrite Makefiles and Kconfig files ...') # rewrite Makefile and source symbols |