4 import importlib.machinery
9 # This defines environment variable ARCH for linux kernel.
10 # Change this to change target architecture
14 # Enviroment variables for Linux
15 kernel_env = {'SRCARCH': kernel_arch, 'ARCH': kernel_arch, 'KERNELVERSION': kernel_arch}
17 # Command executed for kernel build in linux folder.
18 build_command = ['make', '-j', str(multiprocessing.cpu_count())]
21 # Command executed for booting. Output of this command is saved to output folder.
22 boot_command = ['echo', 'bootit']
24 # Set timeout of boot process if no output is generated for selected seconds
28 # Command to parse double value from boot output
29 parse_command = ['echo', '0']
31 # measurement_identifier
32 # Identifier of measurement can consist of measure tool name and version
33 measure_identifier = 'cyclictest-v0.92'
36 # Additional arguments passed to PicoSAT.
40 # Database in PostgreSQL to be used for this tools
41 db_database = 'linux-conf-perf'
44 # Define if measurement and kernel build should be executed in parallel.
47 # Defines maximal number of buffered configurations before generating is suspended.
48 multithread_buffer = 32
50 ## Programs output show/hide
51 # These options hides output of launched programs from terminal.
52 # If variable is True, output is printed. Otherwise is hidden.
53 # What ever are these settings, output is always written to files in folder log.
54 parse_kconfig_output = False
55 picosat_output = False
56 kernel_config_output = True
57 kernel_make_output = True
61 ## Configs for debugging
62 single_loop = False # Executes only one loop and exits.
63 only_config = False # Executes only to configuration phase. Building and booting phases are skipped.
64 ignore_misconfig = False # Ignore if configuration wasn't applied correctly.
65 #######################################
66 # Most probably you don't want touch rest of these.
68 dot_confmk = '.conf.mk'
69 dot_config = 'dot_config'
71 linux_sources = 'linux/'
72 linux_build_folder = 'linux/'
73 linux_image = linux_build_folder + 'arch/' + kernel_arch + '/boot/bzImage'
75 build_folder = 'jobfiles/'
76 jobfolder_linux_image = build_folder + 'linuxImage'
77 symbol_map_file = build_folder + 'symbol_map' # Also defined in parse_kconfig
78 rules_file = build_folder + 'rules' # Also defined in parse_kconfig
79 variable_count_file = build_folder + 'variable_count' # Also defined in parse_kconfig
80 fixed_file = build_folder + 'fixed'
81 measure_file = build_folder + 'measure'
82 dot_measure_file = build_folder + 'dot_measure'
83 dot_config_back_file = build_folder + 'dot_config_back'
84 single_generated_file = build_folder + 'single_generated'
85 measurechecked_file = build_folder + 'measurechecked'
87 buildroot_config_cyclictest = '/dev/null'
89 result_folder = 'result/'
93 parse_kconfig = 'scripts/parse_kconfig/parse'
94 write_config = 'scripts/write_config/write_config'
95 picosat = 'scripts/picosat-959/picosat'
96 allconfig = 'scripts/allconfig/allconfig'
98 #######################################
99 absroot = os.path.dirname(os.path.realpath(__file__))
101 #######################################
102 # Override configuration for specified target
104 target = open(os.path.join(absroot, '.target'), 'r').readline().rstrip()
105 conffile = os.path.join(absroot, 'targets', target, 'conf.py')
107 ovconf = importlib.machinery.SourceFileLoader("module.name", conffile).load_module()
108 for name in dir(ovconf):
109 if not re.match('__*__', name):
110 vars()[name] = vars(ovconf)[name]
112 print("E: Invalid target specifier. Write valid target to .target file.")
115 print("E: No target specifier. Write target to .target file.")