summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/LinHES-config
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-06-07 16:10:13 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-06-07 16:10:13 (GMT)
commit772610032aa3949f558b1317b7bf4c91ef833206 (patch)
tree27d9ffcdfb130767481ed4c597804d05f6cb5194 /abs/core-testing/LinHES-config
parentc608e5c3b0c99200dec959f899580a2b9ce6e6d6 (diff)
parentb8302ff276a5110a3cd128eca7b7d8ed07eb1246 (diff)
downloadlinhes_pkgbuild-772610032aa3949f558b1317b7bf4c91ef833206.zip
linhes_pkgbuild-772610032aa3949f558b1317b7bf4c91ef833206.tar.gz
linhes_pkgbuild-772610032aa3949f558b1317b7bf4c91ef833206.tar.bz2
Merge branch 'linhes-config-python'
* linhes-config-python: linhes-config: on install poll /proc/cmdline for disabled modules and add them to /etc/rc.conf
Diffstat (limited to 'abs/core-testing/LinHES-config')
-rwxr-xr-xabs/core-testing/LinHES-config/mv_install.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/abs/core-testing/LinHES-config/mv_install.py b/abs/core-testing/LinHES-config/mv_install.py
index 1281932..97fbae5 100755
--- a/abs/core-testing/LinHES-config/mv_install.py
+++ b/abs/core-testing/LinHES-config/mv_install.py
@@ -689,6 +689,59 @@ def apply_new_auth():
logging.debug("Applying password updates failed, couldn't open %s", passfile)
logging.debug
+def add_to_blacklist(module):
+ rcfile = data_config.MOUNTPOINT + "/etc/rc.conf"
+ logging.debug(" Attempting to add %s to blacklist", module)
+ newline=''
+ try:
+ f = open(rcfile, 'r')
+ conflines = f.readlines()
+ f.close()
+ except:
+ logging.critical(" *Couldn't open %s for reading",rcfile)
+ return
+
+ try:
+ f = open(rcfile, 'w')
+ except:
+ logging.critical(" *Couldn't open %s for reading",rcfile)
+ return
+
+ for line in conflines:
+ newline = line
+ if re.match("MOD_BLACKLIST",line):
+ logging.debug(line)
+ try:
+ lastpar = line.rindex(')')
+ logging.debug(" found ) at %s", lastpar)
+ newline = line[:lastpar] +" !" + module + " " + line[lastpar:]
+ logging.debug(newline)
+ except:
+ logging.debug("Couldn't find ending )")
+ newline = line
+ f.write(newline)
+ f.close()
+
+def special_hardware_check():
+ logging.info("_____Applying special boot parameters_______")
+ try:
+ f = open('/proc/cmdline', 'r')
+ bootoptions = f.readlines()
+ f.close()
+ except:
+ logging.critical(" *Couldn't open /proc/cmdline")
+ return
+ bootoptions = bootoptions[0].split()
+ logging.debug(" Boot options: %s", bootoptions)
+ for item in bootoptions:
+ logging.debug(item)
+ if re.match("disablemodules",item) != None :
+ logging.debug(" Found disabledmodules")
+ modulelist = item.split("=")[1]
+ for module in modulelist.split(','):
+ add_to_blacklist(module)
+
+
def swapsearch():
#currently unused!
partlist = []
@@ -820,6 +873,7 @@ def full_install(hostoptions):
update_status(msg)
progress(98)
grub_it()
+ special_hardware_check()
# Configuring the system
logging.info("______Configuring system________")
cp_and_log("/etc/systemconfig", data_config.MOUNTPOINT+"/etc/systemconfig")
@@ -1058,6 +1112,7 @@ def upgrade(hostoptions):
grub_it()
time.sleep(1)
#needed to get around a bug with pacman
+ special_hardware_check()
cp_and_log("/root/xorg.conf.install", data_config.MOUNTPOINT+"/etc/X11/xorg.conf.install")
cp_and_log("/etc/mtab", data_config.MOUNTPOINT+"/etc/mtab")
if clean_upgrade() or os.path.exists("/tmp/etc/KnoppMyth-version"):