Linux – stopping kernel module from automatically loading

bootkernel-modulelinux

I am using Angstrom distribution on my Overo board, and I have a little problem. Sometimes kernel modules that are used to handle my camera are loaded at boot time, sometimes not.

I am wondering, is there some file where there are modules listed that should be loaded at boot time? Or is there some other way that the system knows what modules to load?

Anyway, I wanted to make Linux don't load those modules automatically so I always know that I need to load them up manually.

Also I wanted to disable automatic loading of a module that is used for wireless because it takes few seconds for this module to set up and most of the time I am not using wireless net on my board.

Best Answer

I think you are searching the "blacklist" function. From ArchWiki:

Blacklisting, in the context of kernel modules, is a mechanism to prevent the kernel module from loading. This could be useful if, for example, the associated hardware is not needed, or if loading that module causes problems: for instance there may be two kernel modules that try to control the same piece of hardware, and loading them together would result in a conflict.

[...]

Create a .conf file inside /etc/modprobe.d/ and append a line for each module you want to blacklist, using the blacklist keyword. If for example you want to prevent the pcspkr module from loading:

> /etc/modprobe.d/nobeep.conf
> 
> # Do not load the pcspkr module on boot 
> blacklist pcspkr