def add_automatic_backports(args):
export = re.compile(r'^EXPORT_SYMBOL(_GPL)?\((?P<sym>[^\)]*)\)')
bpi = kconfig.get_backport_info(os.path.join(args.outdir, 'compat', 'Kconfig'))
+ configtree = kconfig.ConfigTree(os.path.join(args.outdir, 'Kconfig'))
+ all_selects = configtree.all_selects()
for sym, vals in bpi.iteritems():
+ if sym.startswith('BACKPORT_BUILD_'):
+ if not sym[15:] in all_selects:
+ continue
symtype, module_name, c_files, h_files = vals
# first copy files
git_debug_init(args)
- add_automatic_backports(args)
- git_debug_snapshot(args, 'Add automatic backports')
-
if not args.git_revision:
copy_files(args.kerneldir, copy_list, args.outdir)
else:
git_debug_snapshot(args, 'Add driver sources')
+ add_automatic_backports(args)
+ git_debug_snapshot(args, 'Add automatic backports')
+
logwrite('Apply patches ...')
patches = []
for root, dirs, files in os.walk(os.path.join(source_dir, 'patches')):
syms.append(m.group('sym'))
return syms
+ def all_selects(self):
+ result = []
+ for nf in self._walk(self.rootfile):
+ for l in open(os.path.join(self.basedir, nf), 'r'):
+ m = sel_line.match(l)
+ if m:
+ result.append(m.group('sym'))
+ return result
+
def modify_selects(self):
syms = self.symbols()
for nf in self._walk(self.rootfile):