7 from exceptions import MissingFile
10 "Execute kconfig_parser in linux_sources directory and parsed output is placed to build_folder."
11 env = dict(os.environ)
12 env['SRCARCH'] = conf.SRCARCH
13 env['ARCH'] = conf.ARCH
14 env['KERNELVERSION'] = 'KERNELVERSION' # hides error
16 os.chdir(conf.linux_sources)
17 if conf.kconfig_parser_output:
18 subprocess.call([conf.kconfig_parser, conf.linux_kconfig_head, conf.build_folder, "-v", "-v"], env=env)
20 subprocess.call([conf.kconfig_parser, conf.linux_kconfig_head, conf.build_folder], env=env)
25 "Generates required depenpency from required file."
26 utils.build_symbol_map()
27 srmap = {value:key for key, value in utils.smap.items()}
30 os.remove(conf.required_file)
31 os.remove(conf.dot_config_file)
35 with open(conf.linux_sources + '/.config', 'r') as f:
36 with open(conf.required_file, 'w') as freq:
37 with open(conf.dot_config_file, 'w') as fconf:
39 if (line[0] == '#') or (not '=' in line):
41 indx = line.index('=')
42 if (line[indx + 1] == 'y' or line[indx + 1] == 'm'):
43 freq.write(srmap[line[7:indx]] + "\n")
44 elif (line[indx + 1] == 'n'):
45 freq.write("-" + srmap[line[7:indx]] + "\n")