]> 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 b4c226162ba536a4404855fda724d801a6676c2b..13d5cd76564d118e8708ee7e70816c9e1a98b8bb 100644 (file)
--- a/conf.py
+++ b/conf.py
@@ -2,6 +2,7 @@ import os
 import sys
 import re
 import importlib.machinery
+import multiprocessing
 
 ## Global configs
 # kernel_arch
@@ -14,7 +15,7 @@ kernel_arch = 'x86'
 kernel_env = {'SRCARCH': kernel_arch, 'ARCH': kernel_arch, 'KERNELVERSION': kernel_arch}
 # build_command
 # Command executed for kernel build in linux folder.
-build_command = ['make']
+build_command = ['make', '-j', str(multiprocessing.cpu_count())]
 
 # boot_command
 # Command executed for booting. Output of this command is saved to output folder.
@@ -38,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 = 'user'
-# db_password
-# Define PostrgreSQL user password
-db_password = 'password'
-# 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.
@@ -58,13 +47,6 @@ 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.
@@ -87,9 +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/bzImage'
+linux_build_folder = 'linux/'
+linux_image = linux_build_folder + 'arch/' + kernel_arch + '/boot/bzImage'
 
 build_folder = 'jobfiles/'
 jobfolder_linux_image = build_folder + 'linuxImage'
@@ -103,6 +84,8 @@ dot_config_back_file = build_folder + 'dot_config_back'
 single_generated_file = build_folder + 'single_generated'
 measurechecked_file = build_folder + 'measurechecked'
 
+buildroot_config_cyclictest = '/dev/null'
+
 result_folder = 'result/'
 log_folder = 'log/'
 
@@ -116,20 +99,18 @@ allconfig = 'scripts/allconfig/allconfig'
 absroot = os.path.dirname(os.path.realpath(__file__))
 
 #######################################
-# Overlap configuration for specified target
-if os.path.isfile(os.path.join(absroot, '.target')):
-       target = None
-       with open(os.path.join(absroot, '.target'), 'r') as f:
-               target = f.readline().rstrip()
+# 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')
-       if os.path.isfile(conffile):
+       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]
-       else:
+       except:
                print("E: Invalid target specifier. Write valid target to .target file.")
                sys.exit(-99)
-else:
+except:
        print("E: No target specifier. Write target to .target file.")
        sys.exit(-99)