[Hi faithful readers. You might or might not know that I am somewhat a computer nerd, going back to junior high when I built a computer (and installed Redhat Linux 5.2!) with my brother. I have decided to finally begin documenting some of the more difficult and obscure things I figure out in computer-land, since they are generally difficult because no coherent documentation or guidance is to be found...]
The method for disabling the loading of specific modules is at the bottom of this post.
The scenario: I have an IBM ThinkPad X30 which has an Intersil Prism 2.5 chipset for wireless networking. The firmware is a revision which has support for WPA2 security. The process of updating the firmware to this revision was somewhat of an ordeal which I hopefully will document later. This wireless chipset is somewhat unique in that the Linux kernel has two different drivers which support it, orinoco (implicated by the hermes module) and hostap. The orinoco driver, however, doesn’t support WPA2 encryption. Guess which driver loads first by default in my Debian Etch (4.0) setup and precludes the other from working? Yes, the less functional orinoco driver.
Since for various reasons I require WPA2 encryption from time to time, I had to find a way to make the hostap driver load first. Of course, I could always recompile the kernel and exclude the orinoco driver, but this becomes tedious every time Debian security releases a patched kernel. Plus, it’s time-consuming, and isn’t the point of a modular kernel to make it possible to add and remove the modules you want without recompiling?
So after attempts with /etc/modprobe.d/blacklist and other obvious methods of preventing modules from loading which didn’t work [I should retrace my steps and document the failed methods better, I am sorry], I found the right method on an online forum. I am posting it here hoping it might be easier for those in a similar situation to find.
(As root) create a file named
/etc/modprobe.d/00local
Edit the file to contain the following text:
install hermes /bin/true install orinoco /bin/true install orinoco_pci /bin/true
Replace “hermes,” “orinoco,” etc. with whatever modules you are hoping to prevent from loading.
You can list as many or as few modules as you need in the 00local file.
The program /bin/true is a program to “do nothing, successfully” according to the manpage (man true). So this method somehow changes what command is run when a process prompts the loading of a module from <modprobe modulename> to </bin/true>, thus doing nothing, instead of loading the module you never wanted. Beautiful. According to this discussion:http://www.cyberciti.biz/tips/avoid-linux-kernel-module-driver-autoloading.html, where I found this method, it works for Fedora 7 at least. Not sure about other distributions. I confirm it works for Debian etch (4.0). This means it might work for Ubuntu as well.
7 Comments
Friday, July 25, 2008 at 22
James, I had no idea you were a fellow nerd!
I’ve been using Ubuntu for about 3-4 months, though the Linux bug bit me a year ago. I started with OpenSUSE 10.2.
Anyways, we should get together again some time soon.
-Mike
Saturday, August 2, 2008 at 21
Very nice!!
Monday, October 6, 2008 at 21
Testing comments.
Sunday, October 19, 2008 at 17
James – Thanks for posting this little gem. I’ve always liked the idea of a program that “does nothing” and recognised that “doing nothing” is very valuable in some circumstances. As you say it is not simply a null statement, true is actually “doing nothing” in a very positive way.
Anyway, enough of that! I’ve been trying to blacklist a modules for some time using the modprobe.d blacklist file. Like you I’ve had no success. Your little suggestion works a treat, Thanks very much, Neil
Wednesday, February 4, 2009 at 14
I use prism2.5 cards in my Access-point (debian etch). My blacklist file seemed to work fine. It is quite a challenge getting WPA working (through hostapd). So for the time being it is WEP only for me. Btw, using 1.7.4 drivers seemed to be the most stable for my cards.
Saturday, August 15, 2009 at 05
Finally, after a couple of hours fiddling with blacklist, blacklist.conf, blacklist-ath5k.conf, several reboots, searching through the net, the right solution! Thanks a lot!
Wednesday, October 7, 2009 at 02
Thanks, works great.