From 1562ecf132ebb4f43d5b797013c7d397a69c639c Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 1 Mar 2011 14:56:50 -0500 Subject: [PATCH] do not try to load blacklisted modules --- initscripts/pl_hwinit | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/initscripts/pl_hwinit b/initscripts/pl_hwinit index 80f2849..2c0a7aa 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 = ("blacklist", "blacklist-compat", "blacklist-firewire") + 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!" -- 2.43.0