aboutsummaryrefslogtreecommitdiff
path: root/scripts/initialize.py
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-04-27 21:31:03 +0200
committerKarel Kočí <cynerd@email.cz>2015-04-27 21:31:03 +0200
commite89081c8ae3ba5cc42a7f387b267f02ea5a4e8f1 (patch)
tree26e139e120f19a928fe8e2ea1a4b21802ce8ef29 /scripts/initialize.py
parent99a8f39ae04baf1de67659a13d816eb3b89daa99 (diff)
downloadlinux-conf-perf-e89081c8ae3ba5cc42a7f387b267f02ea5a4e8f1.tar.gz
linux-conf-perf-e89081c8ae3ba5cc42a7f387b267f02ea5a4e8f1.tar.bz2
linux-conf-perf-e89081c8ae3ba5cc42a7f387b267f02ea5a4e8f1.zip
Chnage conf paths from absolute to relative
Diffstat (limited to 'scripts/initialize.py')
-rw-r--r--scripts/initialize.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/scripts/initialize.py b/scripts/initialize.py
index 8b04610..8fb06df 100644
--- a/scripts/initialize.py
+++ b/scripts/initialize.py
@@ -5,41 +5,42 @@ import shutil
import utils
from conf import conf
+from conf import sf
from exceptions import MissingFile
def parse_kconfig():
"Execute parse_kconfig in linux_sources directory."
env = dict(os.environ)
wd = os.getcwd()
- os.chdir(conf.linux_sources)
+ os.chdir(sf(conf.linux_sources))
if conf.parse_kconfig_output:
- subprocess.call([conf.parse_kconfig, conf.linux_kconfig_head, conf.build_folder, "-v", "-v"], env=utils.get_kernel_env())
+ subprocess.call([sf(conf.parse_kconfig), sf(conf.linux_kconfig_head), sf(conf.build_folder), "-v", "-v"], env=utils.get_kernel_env())
else:
- subprocess.call([conf.parse_kconfig, conf.linux_kconfig_head, conf.build_folder], env=utils.get_kernel_env())
+ subprocess.call([sf(conf.parse_kconfig), sf(conf.linux_kconfig_head), sf(conf.build_folder)], env=utils.get_kernel_env())
os.chdir(wd)
def gen_requred():
"Generates required depenpency from .config file in linux source tree."
- if not os.path.isfile(conf.linux_sources + '/.config'):
- raise MissingFile(conf.linux_sources + '/.config',
+ if not os.path.isfile(sf(conf.linux_dot_config)):
+ raise MissingFile(sf(conf.linux_dot_config),
'Generate initial configuration. Execute make defconfig in linux folder. Or use make menuconfig and change configuration.')
utils.build_symbol_map() # Ensure smap existence
srmap = {value:key for key, value in utils.smap.items()}
try:
- os.remove(conf.required_file)
- os.remove(conf.dot_config_fragment_file)
+ os.remove(sf(conf.required_file))
+ os.remove(sf(conf.dot_config_fragment_file))
except OSError:
pass
- shutil.copy(conf.linux_dot_config, conf.dot_config_back_file)
+ shutil.copy(sf(conf.linux_dot_config), sf(conf.dot_config_back_file))
- with open(conf.linux_sources + '/.config', 'r') as f:
- with open(conf.required_file, 'w') as freq:
- with open(conf.dot_config_fragment_file, 'w') as fconf:
+ with open(sf(conf.linux_dot_config), 'r') as f:
+ with open(sf(conf.required_file), 'w') as freq:
+ with open(sf(conf.dot_config_fragment_file), 'w') as fconf:
for line in f:
if (line[0] == '#') or (not '=' in line):
continue