From 9262ad513b02f99f097d8e9808fcb18c1f611b26 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 29 Apr 2014 11:31:28 +0200 Subject: [PATCH] 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 Signed-off-by: Luis R. Rodriguez --- gentree.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gentree.py b/gentree.py index 44acb9a1250e..10588842fdfa 100755 --- a/gentree.py +++ b/gentree.py @@ -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 -- 2.30.2