summaryrefslogtreecommitdiffstats
path: root/abs/core-testing
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-06-07 16:04:59 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-06-07 16:04:59 (GMT)
commitb8302ff276a5110a3cd128eca7b7d8ed07eb1246 (patch)
tree9a3cce54f4346ccd9c20bdc89eb5f41e7eb5bc97 /abs/core-testing
parent4c3293b79113967cfe86eab4ff6ec974f809e07e (diff)
downloadlinhes_pkgbuild-b8302ff276a5110a3cd128eca7b7d8ed07eb1246.zip
linhes_pkgbuild-b8302ff276a5110a3cd128eca7b7d8ed07eb1246.tar.gz
linhes_pkgbuild-b8302ff276a5110a3cd128eca7b7d8ed07eb1246.tar.bz2
linhes-config: on install poll /proc/cmdline for disabled modules and add them to /etc/rc.conf
Diffstat (limited to 'abs/core-testing')
-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"):