# SOLVED - coldplug and hotplug not respecting blacklist

## SirronD

HELP!

All of a sudden (after an emereg --update --deep world) coldplug or hotplug is not respecting /etc/hotplug/blacklist

I have a couple of network drivers in /etc/hotplug/blacklist so that they will not be loaded at boot. Specifically I don't want my network up at boot. But only when I manually bring it up.

To accomplish this easily, I added the network drivers "tg3", and "bcmw43xx" to my blacklist. When I needed the network I would modprobe either the wired (tg3) or wireless (bcmw43xx).

Now, these are being loaded at boot by some "magic". Hotplug and coldplug are supposed to respect the /etc/hotplug/blacklist but that seems to no longer be the case. Or there is some other new process that is probing the devices and loading the modules.

Does anybody know how to create a blacklist for modules that should NOT be autoloaded at boot by coldplug/hotplug?

Does anybody know what process is loading these modules at boot (if it is not coldplug or hotplug)?

ThanksLast edited by SirronD on Fri Apr 21, 2006 7:09 am; edited 2 times in total

----------

## yabbadabbadont

It might be the new udev.  It apparently has replaced the coldplug functionality internally.  In fact, usually there is an error message when you try to update udev to the new version that coldplug is blocking it...  You didn't see anything like that did you?

----------

## James Wells

I too am seeing this problem now.   My versions are;

    udev-090

    hotplug-20040923-r1

    genkernel-3.3.11d

----------

## SirronD

Thanks yabbadabbadont. It is udev that is causing the problem. I had "--unmerged" coldplug when I updated to the new udev

Knowing it is udev, I did a "man udev" and studied it. Of course.... no examples  :Sad:  so I'm not really sure what is going on. 

But I modified the /etc/udev/rules.d/50-udev.rules script. There is a section titled "Module autolading". I commented out the line.

Before

```

# Module autoloading

# Autoload modules that lack aliases but have them defined inutoload modules

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

```

After

```

# Module autoloading

# Autoload modules that lack aliases but have them defined inutoload modules

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

```

Everything now "seems" to work and my network is not loaded at boot (which really is all I wanted).

However, my solution seems rather drastic It would be much better if there was some type of blacklist for udev at boot. Specially if you have network devices for networks that may or may-not be available at boot.

But for now it is working.

----------

## Jakub

Apparently the blacklist functionality has been moved to /etc/modprobe.d/blacklist but it doesn't seem to work for me either. Damn.

----------

## yabbadabbadont

Just gotta love progress.....   :Rolling Eyes: 

----------

## James Wells

 *SirronD wrote:*   

> 
> 
> After
> 
> ```
> ...

 

   I went ahead and implemented this on my laptop and it does exactly what I was looking for.  Thanx.

----------

## SirronD

OK after going through tons of googles and forum searches, I found the real solution to my problem.

First, if you modified your /etc/udev/rules.d/50-udev.rules script, you can set it back to its original.

The file to modify is /etc/conf.d/rc

Before

```

# Dynamic /dev managers can trigger coldplug events which cause services to

# start before we are ready for them. If this happens, we can defer these

# services to start in the boot runlevel. If you don't want this then set

# RC_COLDPLUG to no.

# For more fine grained control you can list full service names to allow

# them to coldplug and prefix them with ! so they don't coldplug.

# Example - RC_COLDPLUG="net.wlan !net.*"

# This allows net.wlan and any service not matching net.* to coldplug.

RC_COLDPLUG="yes"

```

After

```

# Dynamic /dev managers can trigger coldplug events which cause services to

# start before we are ready for them. If this happens, we can defer these

# services to start in the boot runlevel. If you don't want this then set

# RC_COLDPLUG to no.

# For more fine grained control you can list full service names to allow

# them to coldplug and prefix them with ! so they don't coldplug.

# Example - RC_COLDPLUG="net.wlan !net.*"

# This allows net.wlan and any service not matching net.* to coldplug.

RC_COLDPLUG="!net.eth*"

```

For me I did not want my net.eth* services at boot. This stops them from coming up at boot in a way that is "intended" by the developers.

----------

## James Wells

Unfortunately, this solution doesn't do what I need.  It's nice that it won't start the services, but with this "solution" it still loads the modules for these devices, which I an trying to avoid.

   In my system (Laptop), I have an 8139 network card, a fireware port, and a wifi card.  Now, with the udev change, suddenly the system started loading the modules, and rc scripts for all three of these.  The 8139 is not that big a deal, the firewire is an annoyance, but the wifi card sucks up a lot of juice.  As soon as the wifi driver loads, it turns on the wifi card's radio and begins the power bleed.

   With previous versions of udev, I could use the blacklist feature to keep udev/coldplug from loading the wifi driver modules, unless specifically loaded by the rc script.

----------

## dch24

This post describes the difference between 'blacklist' and what you are trying to do:

 *Joey Hess wrote:*   

> Package: module-init-tools
> 
> Version: 3.3-pre11-1
> 
> Severity: normal
> ...

 

In other words, this will disable it at the modprobe level. (Then when you want to use it, just add a # to comment out the line, and run update-modules and modprobe it in. Not exactly what you wanted, but ...)

There's a good discussion in the bug #130766 thread about using /etc/conf.d/rc to disable services (so the modules are still loaded but the service doesn't get started) and about the security hole opened by autoloading evbug. The bug is closed because "Comment  #46 From Matthias Schwarzott  2007-02-13 00:16:10 0000  [reply] udev-104-r11 (and -r10) implement the wrapper-based blacklisting, by using the blacklist-lines from modprobe.conf" but I have not seen documentation or an example of how this works.

----------

## Nargule

 *James Wells wrote:*   

> Unfortunately, this solution doesn't do what I need.  It's nice that it won't start the services, but with this "solution" it still loads the modules for these devices, which I an trying to avoid.

 

I changed the line to RC_COLDPLUG="no" and none of the modules load on boot. I'm using udev-104-r12.

----------

