]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blobdiff - conf.py
Allow importing lcp_django from other python scripts
[linux-conf-perf.git] / conf.py
diff --git a/conf.py b/conf.py
index c077d77575d24ddce9b24c9bb539d1d9dbd0082d..13d5cd76564d118e8708ee7e70816c9e1a98b8bb 100644 (file)
--- a/conf.py
+++ b/conf.py
@@ -1,35 +1,32 @@
 import os
+import sys
+import re
+import importlib.machinery
+import multiprocessing
 
 ## Global configs
 # kernel_arch
 # This defines environment variable ARCH for linux kernel.
 # Change this to change target architecture
-kernel_arch = 'powerpc'
+kernel_arch = 'x86'
 
 # kernle_env
 # Enviroment variables for Linux
 kernel_env = {'SRCARCH': kernel_arch, 'ARCH': kernel_arch, 'KERNELVERSION': kernel_arch}
-# linux_make_args
-# These are arguments passed to make when linux is build.
-linux_make_args = ['-j8']
 # build_command
 # Command executed for kernel build in linux folder.
-build_command = ['../build_script']
-
-# novaboot_args
-# These are arguments passed to Novaboot,
-# but only if you don't remove it from boot_command.
-novaboot_args = ['--qemu=qemu-system-x86_64']
-# nbscript
-# This variable is path to Novaboot script.
-nbscript = 'scripts/nbscript'
+build_command = ['make', '-j', str(multiprocessing.cpu_count())]
+
 # boot_command
 # Command executed for booting. Output of this command is saved to output folder.
-boot_command = ['./boot_script']
+boot_command = ['echo', 'bootit']
+# boot_timeout
+# Set timeout of boot process if no output is generated for selected seconds
+boot_timeout = 120
 
 # parse_command
 # Command to parse double value from boot output
-parse_command = ['./parse_script']
+parse_command = ['echo', '0']
 
 # measurement_identifier
 # Identifier of measurement can consist of measure tool name and version
@@ -42,18 +39,6 @@ picosat_args = []
 # db_database
 # Database in PostgreSQL to be used for this tools
 db_database = 'linux-conf-perf'
-# db_user
-# Define PostgreSQL user
-db_user = 'kocikare'
-# db_password
-# Define PostrgreSQL user password
-db_password = 'ohNg3Ien'
-# db_host
-# Address of PostgreSQL database server
-db_host = 'localhost'
-# db_port
-# Port of PotgreSQL database server
-db_port = 5432
 
 # multithread
 # Define if measurement and kernel build should be executed in parallel.
@@ -62,22 +47,15 @@ multithread = False
 # Defines maximal number of buffered configurations before generating is suspended.
 multithread_buffer = 32
 
-# git_describe_cmd
-# Command used for getting tools version and status from git
-git_describe_cmd = ['git', 'describe', '--always', '--tags', '--dirty']
-# git_commit_cmd
-# Command used for getting commit hash from git
-git_commit_cmd = ['git', 'rev-parse', '--verify', 'HEAD']
-
 ## Programs output show/hide
 # These options hides output of launched programs from terminal.
 # If variable is True, output is printed. Otherwise is hidden.
 # What ever are these settings, output is always written to files in folder log.
 parse_kconfig_output = False
 picosat_output = False
-kernel_config_output = False
-kernel_make_output = False
-boot_output = False
+kernel_config_output = True
+kernel_make_output = True
+boot_output = True
 parse_output = False
 
 ## Configs for debugging
@@ -91,14 +69,8 @@ dot_confmk = '.conf.mk'
 dot_config = 'dot_config'
 
 linux_sources = 'linux/'
-linux_kconfig_head = linux_sources + 'Kconfig'
-linux_dot_config = linux_sources + '.config'
-linux_image = linux_sources + 'arch/' + kernel_arch + '/boot/uImage'
-
-buildroot_def_config = 'buildroot_recipe/buildroot.def.config'
-buildroot_inittab_directive = 'buildroot_recipe/inittab_directive'
-buildroot_initscript = 'scripts/buildroot_recipe/linux-conf-perf'
-buildroot_initram = 'buildroot/output/images/rootfs.cpio.gz'
+linux_build_folder = 'linux/'
+linux_image = linux_build_folder + 'arch/' + kernel_arch + '/boot/bzImage'
 
 build_folder = 'jobfiles/'
 jobfolder_linux_image = build_folder + 'linuxImage'
@@ -110,11 +82,10 @@ measure_file = build_folder + 'measure'
 dot_measure_file = build_folder + 'dot_measure'
 dot_config_back_file = build_folder + 'dot_config_back'
 single_generated_file = build_folder + 'single_generated'
+measurechecked_file = build_folder + 'measurechecked'
 
-configurations_folder = 'configurations/'
-hashconfigsort = configurations_folder + 'hashconfigsort'
+buildroot_config_cyclictest = '/dev/null'
 
-output_folder = 'output/'
 result_folder = 'result/'
 log_folder = 'log/'
 
@@ -124,5 +95,22 @@ write_config = 'scripts/write_config/write_config'
 picosat = 'scripts/picosat-959/picosat'
 allconfig = 'scripts/allconfig/allconfig'
 
-
+#######################################
 absroot = os.path.dirname(os.path.realpath(__file__))
+
+#######################################
+# Override configuration for specified target
+try:
+       target = open(os.path.join(absroot, '.target'), 'r').readline().rstrip()
+       conffile = os.path.join(absroot, 'targets', target, 'conf.py')
+       try:
+               ovconf = importlib.machinery.SourceFileLoader("module.name", conffile).load_module()
+               for name in dir(ovconf):
+                       if not re.match('__*__', name):
+                               vars()[name] = vars(ovconf)[name]
+       except:
+               print("E: Invalid target specifier. Write valid target to .target file.")
+               sys.exit(-99)
+except:
+       print("E: No target specifier. Write target to .target file.")
+       sys.exit(-99)