7 f_allconfig = open(sys.argv[1], 'r')
8 f_options = open(sys.argv[2], 'r')
10 f_measure = open(conf.measure_file, 'w')
11 f_fixed = open(conf.fixed_file, 'w')
13 variable_options = set()
14 for line in f_options:
15 option = line.split('=')[0][7:] # Remove CONFIG_ (7 chars)
16 variable_options.add(option)
18 utils.build_symbol_map() # Ensure smap existence
19 srmap = {value:key for key, value in utils.smap.items()} # swap dictionary
21 for line in f_allconfig:
22 if (line[0] == '#') or (not '=' in line):
24 sym, val = line.rstrip().split('=')
25 sym = sym[7:] # Remove CONFIG_
26 if sym == "MODULES" and val == 'y':
27 raise exceptions.ConfigurationError("Fixed kernel configuration must have MODULES disabled.")
28 if sym in variable_options:
29 print(srmap[sym], file=f_measure)
31 print(srmap[sym] * (-1 if val == 'n' else +1), file=f_fixed)