# How do I prevent a module from loading at boot?

## timeBandit

For some reason, the joydev module loads when I boot my workstation, even though I don't have a joystick connected. I want to prevent that. There is no joystick connected and nothing is using the module--I can rmmod joydev just fine.

I could just delete the module from /lib/modules but that's crude. I want the module around in case I do connect a joystick, but since I seldom do, I want it loaded only on demand.

I've looked in the obvious places--no joy (pun intended):

```
# find /etc \( -name gconf -prune \) -o -type f -exec grep -il joy "{}" +

/etc/mplayer/menu.conf

/etc/mplayer/input.conf

/etc/modprobe.devfs

/etc/gnome-vfs-mime-magic

/etc/ssl/certs/ca-certificates.crt

/etc/ssl/certs/ca-cert.pem

/etc/ssl/certs/vsigntca.pem

/etc/security/console.perms

/etc/splash/livecd-2007.0/images/background-1920x1200.png

/etc/splash/livecd-2007.0/images/background-1680x1050.png

/etc/splash/livecd-2007.0/images/verbose-1920x1080.png

/etc/splash/livecd-2006.1/images/verbose-1600x1200.png

/etc/splash/livecd-2006.1/images/background-640x480.png

# grep -i joy /etc/modprobe.devfs

alias /dev/js* /dev/joysticks

# find /usr/share/hal -type f -exec grep -il joy "{}" +

/usr/share/hal/fdi/information/10freedesktop/20-video-quirk-pm-misc.fdi

/usr/share/hal/fdi/information/10freedesktop/30-keymap-misc.fdi
```

Those aliases don't seem relevant, especially given /dev/j[os]* do not exist even with the module loaded. The hits in /usr/share/hal and /etc/security/console.perms are also irrelevant (not references to joysticks at all).

What have I missed? I suspect one of udev, hald or the USB subsystem is behind this, but can't find what controls it.  :Confused: 

----------

## sera

```
vim /etc/modprobe.d/blacklist.conf
```

```
blacklist <modulename>
```

This should work.

----------

## timeBandit

Won't that also prevent udev from loading the module when a joystick is hotplugged? The inline comments suggest it will. I was unclear: By "on demand" I didn't mean "manually." I still want udev/hal/whatever to do its thing, just only when a joystick is actually present.

As a last resort, I could rmmod it in /etc/conf.d/local.start but that's a treatment, not a cure.

----------

