From d3b96ca6467f51219c9301cfef12b49aa28c2d76 Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Fri, 2 Oct 2009 15:22:52 +0300 Subject: [PATCH] Moved kernel autogeneration function to a meaningful directory Als updated parse options to save oldconfig file when -r option is used. --- config/parse_options.py | 6 +++--- scripts/kernel/__init__.py | 0 scripts/{conts => kernel}/generate_kernel_cinfo.py | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 scripts/kernel/__init__.py rename scripts/{conts => kernel}/generate_kernel_cinfo.py (96%) diff --git a/config/parse_options.py b/config/parse_options.py index 766df81..5909422 100644 --- a/config/parse_options.py +++ b/config/parse_options.py @@ -2,7 +2,7 @@ # -*- mode: python; coding: utf-8; -*- # from optparse import OptionParser -import os, sys +import os, sys, shutil PROJRELROOT = '../' @@ -45,6 +45,6 @@ def build_parse_options(): if autogen_true: generate_container_cml(options.arch, options.ncont) if options.reset_old_config == 1 and os.path.exists(CML2_OLDCONFIG_FILE): - print "Deleting %s" % CML2_OLDCONFIG_FILE - os.remove(CML2_OLDCONFIG_FILE) + print "Moving %s to unused file %s" % (CML2_OLDCONFIG_FILE, CML2_OLDCONFIG_FILE + '.saved') + shutil.move(CML2_OLDCONFIG_FILE, CML2_OLDCONFIG_FILE + '.saved') diff --git a/scripts/kernel/__init__.py b/scripts/kernel/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/scripts/conts/generate_kernel_cinfo.py b/scripts/kernel/generate_kernel_cinfo.py similarity index 96% rename from scripts/conts/generate_kernel_cinfo.py rename to scripts/kernel/generate_kernel_cinfo.py index 57ab36a..2e90400 100755 --- a/scripts/conts/generate_kernel_cinfo.py +++ b/scripts/kernel/generate_kernel_cinfo.py @@ -161,8 +161,10 @@ pager_ifdefs_todotext = \ /* * TODO: * This had to be defined this way because in CML2 there - * is no straightforward way to derive symbols from expressions - * (a ternary expression of (? : ) form complains for type deduction. + * is no straightforward way to derive symbols from expressions, even + * it is stated in the manual that it can be done. + * As a workaround, a ternary expression of (? : ) was tried but this + * complains that type deduction could not be done. */''' pager_ifdefs = \ @@ -186,6 +188,7 @@ def generate_pager_memory_ifdefs(containers): c.id, c.id, \ c.id, c.id, c.id) return pager_ifdef_string + def generate_kernel_cinfo(containers, cinfo_path): pager_ifdefs = generate_pager_memory_ifdefs(containers) with open(cinfo_path, 'w+') as cinfo_file: