Click to See Complete Forum and Search --> : Disabling module at boot


TheCatMan
06-25-2008, 12:32 PM
I was recently given a USB 2.0 memory stick that doesn't seem to get on with the ehci_hcd module. I plug the stick in and nothing happens (except for a load of cryptic messages when I use dmesg|tail), until I rmmod ehci_hcd. Then I can get on and mount it.

I've reproduced this in Puppy 4, Mandriva 2006 & Manriva 2008.1.

The problem is, I want to boot Puppy from the stick, but Puppy loads the module fairly early in the boot process, loses access to its files and drops me to a shell. I can unload the module there but I can't persuade it to restart booting where it left off.

What I'm looking for is a way to disable that specific module without disabling USB altogether, preferably via a boot parameter. Failing that, a way to restart the boot process would help.

I've tried disabling ehci_hcd in Puppy's init scripts (in pup400.sfs), and renamed the module (in zdrv400.sfs), but it doesn't help.

Any suggestions?

E1PHOTON
06-25-2008, 01:46 PM
Have a look in
/etc/modprobe.d/blacklist or something like that -- distros change it around a little bit.

All you have to do is blacklist the module you don't want inserted, and voila!

James

TheCatMan
06-27-2008, 07:07 AM
Thanks for the reply. It didn't work, but googling "module blacklist" has given me some more stuff to try. :D

From what I've read, the file only blacklists aliases, so the kernel can still load a module by calling it by name. I'm not sure if that's distro specific, or if I used the wrong syntax. There were some suggestions on ways to blacklist modules that sound like they might work, so I'll try them out next chance I get.

bwkaz
06-27-2008, 06:47 PM
From what I've read, the file only blacklists aliases, so the kernel can still load a module by calling it by name. The "blacklist" statement's argument is a module name. The effect is that any aliases of that module can't result in that module being used. (The aliases aren't disallowed completely, though. Say you have two modules that both have an alias of e.g. xxyy*, and the first is blacklisted. Then if you try to modprobe xxyy1, then the second module will be the one that loads. You'd have to blacklist both of them to disable the xxyy* alias completely.)

But anyway, the whole point is that hardware drivers are loaded using their aliases. So if you have a piece of hardware (e.g. a USB2 host) that would normally load the ehci-hcd module via its alias (because it would -- USB host PCI devices should load drivers based on aliases, not explicit names), then if you blacklist ehci-hcd, it won't get loaded unless you explicitly ask for it. The distro should not be asking for it specifically, though. (On the other hand, if it is, you can find that spot and disable it too. ;))

I'm not sure if that's distro specific, or if I used the wrong syntax. It's not distro specific. The syntax should be:

blacklist ehci-hcd

(and I think you can use ehci_hcd as well). But you have to do this before booting the system up, of course; otherwise ehci-hcd will already be loaded. :)