X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=initscripts%2Fpl_hwinit;h=7985511c1425a374213cc6b629bb23f080d0634b;hb=3a1395e98af9ff1604fb6ddb0f54c1dd2bba055e;hp=80f284990f76f87f5309b037a59ddc1958474101;hpb=501729aaa7ce5180c77b05858aa57573281adb11;p=bootcd.git diff --git a/initscripts/pl_hwinit b/initscripts/pl_hwinit index 80f2849..7985511 100755 --- a/initscripts/pl_hwinit +++ b/initscripts/pl_hwinit @@ -31,6 +31,18 @@ def main(argv): else: path = "/lib/modules/%s/modules.pcimap" % kernel + blacklisted_modules = [] + blacklists = os.listdir("/etc/modprobe.d") + for blacklist in blacklists: + blf = "/etc/modprobe.d/%s" % blacklist + if os.path.exists(blf): + f = open(blf) + for i in f.readlines(): + if i.startswith("blacklist"): + blacklisted_modules.append(i.split()[1]) + # unify the list + blacklisted_modules = list(set(blacklisted_modules)) + pcimap = pypcimap.PCIMap(path) print now(),"pl_hwinit: loading applicable modules" devices = pypci.get_devices() @@ -54,8 +66,9 @@ def main(argv): # FIXME: This needs improved logic in the case of multiple matching modules for module in modules: - print now(),"pl_hwinit: found and loading module %s (%s)" % (module, slot) - modprobe(module) + if module not in blacklisted_modules: + print now(),"pl_hwinit: found and loading module %s (%s)" % (module, slot) + modprobe(module) if network_devices == 0: print now(),"pl_hwinit: no supported network devices found!"