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 # These are arguments passed to make when linux is build.
16 linux_make_args = ['-j8']
18 # Command executed for kernel build in linux folder.
19 build_command = ['make'] + linux_make_args
22 # These are arguments passed to Novaboot,
23 # but only if you don't remove it from boot_command.
24 novaboot_args = ['--qemu=qemu-system-x86_64']
26 # This variable is path to Novaboot script.
27 nbscript = 'scripts/nbscript'
29 # Command executed for booting. Output of this command is saved to output folder.
30 boot_command = ['echo', 'bootit']
33 # Command to parse double value from boot output
34 parse_command = ['echo', '0']
36 # measurement_identifier
37 # Identifier of measurement can consist of measure tool name and version
38 measure_identifier = 'cyclictest-v0.92'
41 # Additional arguments passed to PicoSAT.
45 # Database in PostgreSQL to be used for this tools
46 db_database = 'linux-conf-perf'
48 # Define PostgreSQL user
51 # Define PostrgreSQL user password
52 db_password = 'password'
54 # Address of PostgreSQL database server
57 # Port of PotgreSQL database server
61 # Define if measurement and kernel build should be executed in parallel.
64 # Defines maximal number of buffered configurations before generating is suspended.
65 multithread_buffer = 32
68 # Command used for getting tools version and status from git
69 git_describe_cmd = ['git', 'describe', '--always', '--tags', '--dirty']
71 # Command used for getting commit hash from git
72 git_commit_cmd = ['git', 'rev-parse', '--verify', 'HEAD']
74 ## Programs output show/hide
75 # These options hides output of launched programs from terminal.
76 # If variable is True, output is printed. Otherwise is hidden.
77 # What ever are these settings, output is always written to files in folder log.
78 parse_kconfig_output = False
79 picosat_output = False
80 kernel_config_output = True
81 kernel_make_output = True
85 ## Configs for debugging
86 single_loop = False # Executes only one loop and exits.
87 only_config = False # Executes only to configuration phase. Building and booting phases are skipped.
88 ignore_misconfig = False # Ignore if configuration wasn't applied correctly.
89 #######################################
90 # Most probably you don't want touch rest of these.
92 dot_confmk = '.conf.mk'
93 dot_config = 'dot_config'
95 linux_sources = 'linux/'
96 linux_kconfig_head = linux_sources + 'Kconfig'
97 linux_dot_config = linux_sources + '.config'
98 linux_image = linux_sources + 'arch/' + kernel_arch + '/boot/bzImage'
100 buildroot_def_config = 'buildroot_recipe/buildroot.def.config'
101 buildroot_inittab_directive = 'buildroot_recipe/inittab_directive'
102 buildroot_initscript = 'scripts/buildroot_recipe/linux-conf-perf'
103 buildroot_initram = 'buildroot/output/images/rootfs.cpio.gz'
105 build_folder = 'jobfiles/'
106 jobfolder_linux_image = build_folder + 'linuxImage'
107 symbol_map_file = build_folder + 'symbol_map' # Also defined in parse_kconfig
108 rules_file = build_folder + 'rules' # Also defined in parse_kconfig
109 variable_count_file = build_folder + 'variable_count' # Also defined in parse_kconfig
110 fixed_file = build_folder + 'fixed'
111 measure_file = build_folder + 'measure'
112 dot_measure_file = build_folder + 'dot_measure'
113 dot_config_back_file = build_folder + 'dot_config_back'
114 single_generated_file = build_folder + 'single_generated'
116 configurations_folder = 'configurations/'
117 hashconfigsort = configurations_folder + 'hashconfigsort'
119 output_folder = 'output/'
120 result_folder = 'result/'
124 parse_kconfig = 'scripts/parse_kconfig/parse'
125 write_config = 'scripts/write_config/write_config'
126 picosat = 'scripts/picosat-959/picosat'
127 allconfig = 'scripts/allconfig/allconfig'
129 #######################################
130 absroot = os.path.dirname(os.path.realpath(__file__))
132 #######################################
133 # Overlap configuration for specified target
134 if os.path.isfile(os.path.join(absroot, '.target')):
136 with open(os.path.join(absroot, '.target'), 'r') as f:
137 target = f.readline().rstrip()
138 conffile = os.path.join(absroot, 'targets', target, 'conf.py')
139 if os.path.isfile(conffile):
140 ovconf = importlib.machinery.SourceFileLoader("module.name", conffile).load_module()
141 for name in dir(ovconf):
142 if not re.match('__*__', name):
143 vars()[name] = vars(ovconf)[name]
145 print("W: No target specifier. Write target to .target file.")
147 print("W: No target specifier. Write target to .target file.")