]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blob - scripts/kernel.py
kernel configuration now calling write_conf instead of make odlconfig hack
[linux-conf-perf.git] / scripts / kernel.py
1 import os
2 import sys
3 import subprocess
4
5 from conf import conf
6 import utils
7
8 def config():
9         # Executing old linux config
10         env = dict(os.environ)
11         wd = os.getcwd()
12         os.chdir(conf.linux_sources)
13         if conf.kernel_config_output:
14                 sprc = subprocess.call([conf.write_config, conf.linux_kconfig_head,
15                         conf.build_folder], env=utils.get_kernel_env())
16         else:
17                 sprc = subprocess.call([conf.write_config, conf.linux_kconfig_head,
18                         conf.build_folder], stdout=subprocess.DEVNULL,
19                         env=utils.get_kernel_env())
20         os.chdir(wd)
21
22 def config_noprogram():
23         # Executing old linux config
24         env = dict(os.environ)
25         wd = os.getcwd()
26         os.chdir(conf.linux_sources)
27         if conf.kernel_config_output:
28                 sprc = subprocess.call('yes "" | make oldconfig', shell=True,
29                         env=utils.get_kernel_env())
30         else:
31                 sprc = subprocess.call('yes "" | make oldconfig', shell=True,
32                         stdout=subprocess.DEVNULL, env=utils.get_kernel_env())
33         os.chdir(wd)
34
35 def make():
36         wd = os.getcwd()
37         os.chdir(conf.linux_sources)
38         if conf.kernel_make_output:
39                 subprocess.call(['make'] + conf.linux_make_args,
40                                 env=utils.get_kernel_env())
41         else:
42                 subprocess.call(['make'] + conf.linux_make_args,
43                                 stdout=subprocess.DEVNULL, env=utils.get_kernel_env())
44         os.chdir(wd)