Search:  
Gentoo Wiki

HOWTO_prevent_udev_from_loading_certain_modules

If you compiled the pcspkr module udev probably loads the module during boot. To get rid of it there are mainly 3 ways.

Removing the module

For pcspkr this is definitely a solution. Just reconfigure your kernel

Linux Kernel Configuration: PC Speaker
Device Drivers  --->
     Input device support  --->
          [*] Miscellaneous devices  --->
               < > PC Speaker support

or delete the module manually from /lib/modules/`uname -r`/kernel/drivers/input/misc/.

The big drawback of this solution is of course that you lose the module and all the functionality it provides. Thus there might be modules you want to load manually on demand and just not automatically instead of deleting them.

Disabling coldplugging

In /etc/conf.d/rc you can set RC_COLDPLUG to no (see the comments in the file for further documentation)

File: /etc/conf.d/rc
 RC_COLDPLUG="no"
 

But here you disable cold-plugging globally! No modules will be loaded during boot by udev. Therefore other devices besides your PC speaker might not work until you manually load the required modules with modprobe.

You can also add all the modules you need to /etc/modules.autoload.d/kernel-2.6 (or /etc/modules.autoload.d/kernel-2.4 for 2.4 kernels) to force their insertion into the kernel on startup.

Blacklisting the module

To blacklist the module pcspkr add the following line to /etc/modprobe.d/blacklist

File: /etc/modprobe.d/blacklist
 blacklist pcspkr
 

and run update-modules.

This blacklists the module for automatic loading in general not only during boot. So if you blacklist some USB modules they will not be loaded if you plug in the corresponding device.

You can still load blacklisted modules manually. modprobe pcspkr will bring back all the beeping you missed so much.

Retrieved from "http://www.gentoo-wiki.info/HOWTO_prevent_udev_from_loading_certain_modules"

Last modified: Fri, 05 Sep 2008 23:28:00 +0000 Hits: 4,605