summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/LinHES-config/mv_install.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-07-06 04:55:09 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-07-06 04:55:09 (GMT)
commitc65be94a90ca38f456ac7508f285e0def2c05aae (patch)
tree50968ad2d2b57070a6f0c6505050c09afedbec75 /abs/core-testing/LinHES-config/mv_install.py
parentbd85a03ffbbe362d9776483fb5cd5f5c3cdcd230 (diff)
downloadlinhes_pkgbuild-c65be94a90ca38f456ac7508f285e0def2c05aae.zip
linhes_pkgbuild-c65be94a90ca38f456ac7508f285e0def2c05aae.tar.gz
linhes_pkgbuild-c65be94a90ca38f456ac7508f285e0def2c05aae.tar.bz2
LinHES-config: mv_install.py if modules are in /proc/cmdline add them to rc.conf
Diffstat (limited to 'abs/core-testing/LinHES-config/mv_install.py')
-rwxr-xr-xabs/core-testing/LinHES-config/mv_install.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/abs/core-testing/LinHES-config/mv_install.py b/abs/core-testing/LinHES-config/mv_install.py
index 9d2e284..efee91e 100755
--- a/abs/core-testing/LinHES-config/mv_install.py
+++ b/abs/core-testing/LinHES-config/mv_install.py
@@ -770,6 +770,42 @@ def add_to_blacklist(module):
f.write(newline)
f.close()
+
+def add_to_modulelist(module):
+ rcfile = data_config.MOUNTPOINT + "/etc/rc.conf"
+ logging.debug(" Attempting to add %s to modulelist", 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("MODULES=",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:
@@ -789,6 +825,12 @@ def special_hardware_check():
for module in modulelist.split(','):
add_to_blacklist(module)
+ if re.match("modules",item) != None :
+ logging.debug(" Found modules")
+ modulelist = item.split("=")[1]
+ for module in modulelist.split(','):
+ add_to_modulelist(module)
+
def swapsearch():
#currently unused!