X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=initscripts%2Fpl_hwinit;h=7985511c1425a374213cc6b629bb23f080d0634b;hb=ab12c48e13809375bf18cb6c695293f95cb6b9dd;hp=9f598b86c7fd2c334bf365bcf0ec6730113a2dc0;hpb=b13a53f96597821cefa602ed2cbca5d87385ddc3;p=bootcd.git diff --git a/initscripts/pl_hwinit b/initscripts/pl_hwinit index 9f598b8..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() @@ -38,7 +50,8 @@ def main(argv): network_devices = 0 missing = [] globals()['loadedmodules'] = file('/tmp/loadedmodules', 'w') - for (slot, dev) in devices.iteritems(): + for slot in sorted(devices.keys()): + dev = devices[slot] modules = pcimap.get(dev) base = (dev[4] & 0xff0000) >> 16 if len(modules) == 0: @@ -53,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!"