3 import importlib.machinery
7 # This defines environment variable ARCH for linux kernel.
8 # Change this to change target architecture
12 # Enviroment variables for Linux
13 kernel_env = {'SRCARCH': kernel_arch, 'ARCH': kernel_arch, 'KERNELVERSION': kernel_arch}
15 # Command executed for kernel build in linux folder.
16 build_command = ['make']
19 # Command executed for booting. Output of this command is saved to output folder.
20 boot_command = ['echo', 'bootit']
23 # Command to parse double value from boot output
24 parse_command = ['echo', '0']
26 # measurement_identifier
27 # Identifier of measurement can consist of measure tool name and version
28 measure_identifier = 'cyclictest-v0.92'
31 # Additional arguments passed to PicoSAT.
35 # Database in PostgreSQL to be used for this tools
36 db_database = 'linux-conf-perf'
38 # Define PostgreSQL user
41 # Define PostrgreSQL user password
42 db_password = 'password'
44 # Address of PostgreSQL database server
47 # Port of PotgreSQL database server
51 # Define if measurement and kernel build should be executed in parallel.
54 # Defines maximal number of buffered configurations before generating is suspended.
55 multithread_buffer = 32
58 # Command used for getting tools version and status from git
59 git_describe_cmd = ['git', 'describe', '--always', '--tags', '--dirty']
61 # Command used for getting commit hash from git
62 git_commit_cmd = ['git', 'rev-parse', '--verify', 'HEAD']
64 ## Programs output show/hide
65 # These options hides output of launched programs from terminal.
66 # If variable is True, output is printed. Otherwise is hidden.
67 # What ever are these settings, output is always written to files in folder log.
68 parse_kconfig_output = False
69 picosat_output = False
70 kernel_config_output = True
71 kernel_make_output = True
75 ## Configs for debugging
76 single_loop = False # Executes only one loop and exits.
77 only_config = False # Executes only to configuration phase. Building and booting phases are skipped.
78 ignore_misconfig = False # Ignore if configuration wasn't applied correctly.
79 #######################################
80 # Most probably you don't want touch rest of these.
82 dot_confmk = '.conf.mk'
83 dot_config = 'dot_config'
85 linux_sources = 'linux/'
86 linux_kconfig_head = linux_sources + 'Kconfig'
87 linux_dot_config = linux_sources + '.config'
88 linux_image = linux_sources + 'arch/' + kernel_arch + '/boot/bzImage'
90 build_folder = 'jobfiles/'
91 jobfolder_linux_image = build_folder + 'linuxImage'
92 symbol_map_file = build_folder + 'symbol_map' # Also defined in parse_kconfig
93 rules_file = build_folder + 'rules' # Also defined in parse_kconfig
94 variable_count_file = build_folder + 'variable_count' # Also defined in parse_kconfig
95 fixed_file = build_folder + 'fixed'
96 measure_file = build_folder + 'measure'
97 dot_measure_file = build_folder + 'dot_measure'
98 dot_config_back_file = build_folder + 'dot_config_back'
99 single_generated_file = build_folder + 'single_generated'
101 result_folder = 'result/'
105 parse_kconfig = 'scripts/parse_kconfig/parse'
106 write_config = 'scripts/write_config/write_config'
107 picosat = 'scripts/picosat-959/picosat'
108 allconfig = 'scripts/allconfig/allconfig'
110 #######################################
111 absroot = os.path.dirname(os.path.realpath(__file__))
113 #######################################
114 # Overlap configuration for specified target
115 if os.path.isfile(os.path.join(absroot, '.target')):
117 with open(os.path.join(absroot, '.target'), 'r') as f:
118 target = f.readline().rstrip()
119 conffile = os.path.join(absroot, 'targets', target, 'conf.py')
120 if os.path.isfile(conffile):
121 ovconf = importlib.machinery.SourceFileLoader("module.name", conffile).load_module()
122 for name in dir(ovconf):
123 if not re.match('__*__', name):
124 vars()[name] = vars(ovconf)[name]
126 print("W: No target specifier. Write target to .target file.")
128 print("W: No target specifier. Write target to .target file.")