# udev loading kernel modules

## joker

I have couple of kernel modules that I use sometimes, so I didn't add them to my /etc/modules.autoload.d/kernel-2.6 but they are loaded by udev during startup. how to turn it off?

----------

## coolsnowmen

Are you sure its udev? or could it be coldplug (which can load modules).

If you don't want modules autoloaded for you, I'ld disable cold plug first and go from there, besided it will speed things up for you

----------

## joker

I don't even have coldplug installed. It's look like this:

```
* Letting udev process events

ieee80211_crypt: registered algorithm 'NULL'

ieee80211: 802.11 data/management/control stack, git-1.1.7

ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>

bcm43xx driver

ACPI: PCI Interrupt Link [LNKF] enabled at IRQ 10

ACPI: PCI Interrupt 0000:02:05.0[A] -> Link [LNKF] -> GSI 10 (level, low) -> IRQ 10
```

and it's loading bcm43xx module

----------

## coolsnowmen

I could always be wrong.

This is old but: I read this: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ

Implied that udev doesnt load modules (or certainly didnt then).

If /etc/m*a*d/k*6 doesn't have the module in it...

And there is no coldplug...

and lsmod still shows that this module is loaded. . .

Does it say that something is using it? cause if you add a module the requires another to be loaded than it will. (The kernel will autoload it).

If that doesnt explain it...then I'm sorry, I dont know how it could happend.

----------

## joker

I think that nothing using this module. bcm43xx loads other modules:

```
# lsmod

Module                  Size  Used by

fglrx                 508608  7

bcm43xx               117324  0

ieee80211softmac       25856  1 bcm43xx

ieee80211              31496  2 bcm43xx,ieee80211softmac

ieee80211_crypt         5952  1 ieee80211
```

but what loading bcm43xx ?

maybe udev doesn't load this module, bu something must do it. I suggested that it's udev because of this information after "Letting udev process events"

----------

## larmoe

The newer versions of udev replaces the function of coldplug and loads the needed modules at startup. Don't know how to disable it.

Best regards

Lars

----------

## Primozic

The only way I've found to disable this coldplug-like function is to comment out the following line in /etc/udev/rules/50-udev.rules:

```
SYSFS{modalias}=="?*", ACTION=="add", RUN+="/sbin/modprobe $env{MODALIAS}"
```

----------

## FormerSlacker

This behaviour is very anonying especially when certain modules need to be loaded in a specific sequence, or not all the time, and udev decides it knows better and starts loading all the modules it pleases.   :Evil or Very Mad: 

----------

## Headrush

 *FormerSlacker wrote:*   

> This behaviour is very anonying especially when certain modules need to be loaded in a specific sequence, or not all the time, and udev decides it knows better and starts loading all the modules it pleases.  

 

In these case, the order should be able to be forced using modules.autoload

----------

## Gergan Penkov

Me too  :Sad: 

Is there any way to blacklist certain module from loading, as my problem is that I have a card with atheros chipset, which does not work with madwifi, but I try from time to time to make the damn thing behave itself properly, so madwifi-ng and co are installed...

Now in the mean time I use ndiswrapper, which works ... but this udev thing always thinks that the madwifi modules are better and loads them before ndiswrapper and after that it loads ndiswrapper, which in result makes me rmmod all the modules in question and reload only the ndiswrapper, start the net interface and all 5 services, which depend on it.

Well it is once in a while (say a week), but ... I'd better make this somehow automagically.

Earlier it was just so easy with modules.autoload ...

Probably there is some sort of special rule for udev, although I have read the udev-tutorial and haven't seen sth, which could be helpfull.

----------

## FormerSlacker

 *Headrush wrote:*   

>  *FormerSlacker wrote:*   This behavior is very annoying especially when certain modules need to be loaded in a specific sequence, or not all the time, and udev decides it knows better and starts loading all the modules it pleases.   
> 
> In these case, the order should be able to be forced using modules.autoload

 

They are in modules.autoload, the problem is before modules.autoload is even parsed udev is loading modules on its own, in the wrong order, and in some cases loading modules I don't even want to use. In my case I have agpgart modules installed for testing purposes, but I use the Nvidia agp drivers on a day to day basis, and of course udev is loading up agpgart.

I also need to load up btaudio after my sound card drivers are loaded, udev of course is loading btaudio first.

I also have netfilter modules installed, and since I've upgraded udev they are being loaded as well, no idea why. I had to move the modules out of the /lib/modules dir, and copy them over when I specifically need them.

The netfilter modules being loaded I can't blame on udev, since I have no idea why it would bother, but this behaviour started with my latest --sync, so I'm not sure what in the world is loading them on boot time. Iptables init.d is not a startup service, so who knows.

----------

## Headrush

Hmmmm. It use to be that modules.autoload was parsed before udev was even started, maybe something has changed in the last few versions. I'll look into it and see if I can find anything helpful.

----------

## FormerSlacker

 *Headrush wrote:*   

> Hmmmm. It use to be that modules.autoload was parsed before udev was even started, maybe something has changed in the last few versions. I'll look into it and see if I can find anything helpful.

 

Much appreciated.

----------

