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()
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:
# 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!"