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