diff options
Diffstat (limited to 'abs/core-testing/LinHES-config/mv_install.py')
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_install.py | 42 |
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! |