How to correctly blacklist a driver module? My blacklisted Broadcom drivers are still loaded

Hi,
I have put this question on Linux/Unix stack exchange but no one replied and since I run openSuse, I dare to repeat my question here too.

My Broadcom drivers are clearly blacklisted in 50-broadcom-wl-blacklist.conf file in /etc/modprobe.d/:


# modules blacklisted for broadcom-wl
blacklist bcm43xx
blacklist ssb
blacklist b43
blacklist b43legacy
blacklist ndiswrapper
blacklist brcm80211
blacklist bcma
blacklist brcmsmac

But they are still being loaded!


$ lsmod | grep b43
b43legacy             151552  0
b43                   450560  0
bcma                   61440  1 b43
mac80211              888832  2 b43,b43legacy
ssb                    86016  2 b43,b43legacy
mmc_core              163840  2 b43,ssb
cfg80211              696320  4 wl,b43,mac80211,b43legacy

OS: openSUSE Leap 15.0

Some other posts mention running mkinitrd or dracut. When is this relevant for blacklisting modules?

Note, 50-broadcom-wl-blacklist.conf was probably created by some openSUSE tool, I don’t remember creating it. Strange that tool wouldn’t call a mkinitrd if it was necessary.

We are living in systemd era, but I don’t think systemd is not relevant for blacklisting modules (yet).

I am blacklisting this modules because I have to use Broadcom proprietary STA driver with my bcm4360 chipset card.

Original post:
https://unix.stackexchange.com/questions/511570/blacklisted-broadcom-drivers-are-still-loaded

Hi
You need to rebuild initrd, so run the mkinitrd command as root user, reboot and all should be good.

Thank you Malcolm,
Is there any chance Yast2 can run mkinitrd for me? Or any other GUI. But Yast2 is a good guess as one can configure Grub here. One can set kernel boot parameters in Boot Loader module. When I hit OK, one of the 3 steps is clearly labelled as “Create initrd”. That sound promising.

Is there any official openSuse guide or wikipage on blacklisting modules?
Is there any official openSuse guide or wikipage on using mkinitrd? I found only https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.boot.html and that barely scratches surface and don’t even mention mkinitrd.

Honestly, I have no idea what parameters I need and I don’t want to wreck my system.

Hi
Nothing is needed, just run the command… or as you indicated, change something in YaST bootloader and it will also rebuild initrd.

I am sorry to report but nothing helped :frowning:
The drivers are still loaded. Immortal. Unbeatable. Undefeated.
Anyway. I tried mkinitrd, rebooted, Yast2, rebooted, …still there.
Is the file /etc/modprobe.d/50-broadcom-wl-blacklist.conf correct?
How can I troubleshoot this?

Hi
As root user run;


lsinitrd |grep wl

I see (albeit on SLED);


lsinitrd |grep wl
-rw-r--r--   1 root     root          160 May 27  2012 etc/modprobe.d/50-broadcom-wl-blacklist.conf
-rw-r--r--   1 root     root           34 Sep 20  2014 etc/modprobe.d/50-iwl3945.conf
-rw-r--r--   1 root     root      7512512 Mar  6 18:40 lib/modules/4.4.162-94.72-default/updates/wl.ko
lrwxrwxrwx   1 root     root           44 Mar  6 18:39 lib/modules/4.4.175-94.79-default/weak-updates/updates/wl.ko -> ../../../4.4.162-94.72-default/updates/wl.ko

Blacklist only prevents loading of module due to hardware autodetection (strictly speaking, it tells modprobe to ignore internal aliases provided by module). It does not prohibit loading of module by any other means (explicit modprobe, install line in modprobe.conf, explicit alias in modprobe.conf).

Start with showing full output of “journalctl -b” immediately after booting with printk.devkmsg=on kernel parameter (to capture early initrd messages). This may hint at which point modules are loaded.

Thank you Malcolm

I run the same command on my box:


 $ lsinitrd | grep wl
 -rw-r--r--   1 root     root          180 Apr 10 01:32 etc/modprobe.d/50-broadcom-wl-blacklist.conf
 -rw-r--r--   1 root     root           34 Feb 19  2018 etc/modprobe.d/50-iwl3945.conf
 -rw-r--r--   1 root     root      7540355 Mar 23 12:41 lib/modules/4.12.14-lp150.12.48-default/updates/wl.ko

…so same as you. If my interpretation of the results is correct - this means that blacklist IS part of initrd. So there is no issue this direction.

Thank you Arvidjaar,

This is what I found in my system log/journal, this was the first and only trace of ‘b43’ in my log:


Apr 15 01:05:04 systemd[1]: Started Network Manager Script Dispatcher Service.
Apr 15 01:05:04 NetworkManager[1068]: <info>  [1555286704.7000] settings: loaded plugin keyfile: (c) 2007 - 2016 Red Hat, Inc.  To report bugs please use the NetworkManager mailing list.
Apr 15 01:05:04 NetworkManager[1068]: <info>  [1555286704.7231] keyfile: new connection /etc/NetworkManager/system-connections/wired1 (...,"wired1")
...

Apr 15 01:05:04 NetworkManager[1068]: <info>  [1555286704.7712] keyfile: new connection /etc/NetworkManager/system-connections/espinosa5 (...,"espinosa5")
Apr 15 01:05:04 systemd[1]: Started Permit User Sessions.
Apr 15 01:05:04 systemd[1]: Starting X Display Manager...
Apr 15 01:05:04 systemd[1]: Starting Hold until boot process finishes up...
Apr 15 01:05:04 install_bcm43xx_firmware_wrapper[1115]: Downloading b43 firmware
Apr 15 01:05:04 install_bcm43xx_firmware_wrapper[1115]: curl: (6) Could not resolve host: www.lwfinger.com
Apr 15 01:05:04 install_bcm43xx_firmware_wrapper[1115]: Could not download b43 firmware. Please look at /usr/share/doc/packages/b43-fwcutter/README.
Apr 15 01:05:04 install_bcm43xx_firmware_wrapper[1115]: Downloading b43legacy firmware
Apr 15 01:05:04 install_bcm43xx_firmware_wrapper[1115]: curl: (6) Could not resolve host: downloads.openwrt.org
Apr 15 01:05:04 install_bcm43xx_firmware_wrapper[1115]: Could not download b43legacy firmware. Please look at /usr/share/doc/packages/b43-fwcutter/README.
Apr 15 01:05:04 install_bcm43xx_firmware_wrapper[1115]: b43 firmware successfully installed.

There is no search hit on ssb or mac80211.

Searching for install_bcm43xx_firmware_wrapper in /etc found this one:
/etc/systemd/system/multi-user.target.wants/pullin-bcm43xx-firmware.service

So NetworkManager is loading the blacklisted modules?

OK, I simply disabled the suspicious service via systemd call:


systemctl disable pullin-bcm43xx-firmware.service

and rebooted …and voilà …b43 drivers are not loaded anymore; ssb, b43, b43legacy, mac80211; only wl is present.

SOLVED
Thank you, Arvidjaar and Malcolm again.

Have to say, modprobe blacklisting is a bit misnomer. Kernel should have a proper enforceable blacklisting facility!

Are you absolutely certain that, you need the “pullin-bcm43xx-firmware” and / or “bcm43xx-firmware” packages?

A FYI -
Your attempts to invoke modprobe may not have been done correctly.

Here is an example how to blacklist using modprobe properly by way of the legacy SysVinit,

https://en.opensuse.org/User:Tsu2/Virtualization

Note that instead of your attempts to use a blacklist command without your config file, this example uses a blacklist file that should already exist or can be created using the example in my article as a template.

TSU

Blacklisting:

  • ‘/etc/modprobe.d/50-blacklist.conf’ is often OK, but;
  • Sometimes it’s not: if that’s the case then, one has to add “modprobe.blacklist=«Kernel Module Name»” to the Kernel Command Line – use the YaST Bootloader configuration tool.