11 def build_symbol_map():
12 """Generates global variable smap from symbol_map_file.
13 When file not exists, MissingFile exception is raised.
19 # Check if symbol_map_file exist
20 if not os.path.isfile(sf(conf.symbol_map_file)):
21 raise exceptions.MissingFile(sf(conf.symbol_map_file),
22 "Run parse_kconfig to generate it.")
25 with open(sf(conf.symbol_map_file)) as f:
27 w = lnn.rstrip().split(sep=':')
28 smap[int(w[0])] = w[1]
31 def callsubprocess(process_name, process, show_output = True,
32 return_output = False, env=os.environ, allowed_exit_codes = [0],
33 allow_all_exit_codes = False):
34 sprc = subprocess.Popen(process, stdout = subprocess.PIPE, env = env)
37 os.mkdir(os.path.join(sf(conf.log_folder), process_name))
42 with open(os.path.join(sf(conf.log_folder),
43 process_name, time.strftime("%y-%m-%d-%H-%M-%S") + ".log"),
45 f.write('::' + time.strftime("%y-%m-%d-%H-%M-%S-%f") + '::\n')
46 for linen in sprc.stdout:
47 line = linen.decode(sys.getdefaultencoding())
52 rtn.append(line.rstrip())
55 if rtncode not in allowed_exit_codes and not allow_all_exit_codes:
56 raise exceptions.ProcessFailed(process, rtncode)
60 env = dict(os.environ)
61 env.update(conf.kernel_env)