View previous topic :: View next topic |
Author |
Message |
jimmij Tux's lil' helper
Joined: 02 Dec 2008 Posts: 143
|
Posted: Sat Jul 21, 2012 1:01 pm Post subject: How to prevent autoloading modules? |
|
|
I have several modules (eg. uvcvideo, wl) which I do not want to be loaded on startup.
The problem is that they are loading anyway and I cannot figure out who to blame.
They are pulled from /lib/modules, but not all modules from there are loaded, eg. vboxdrv, vboxnetflt behaves normally.
I'm confused.
/etc/conf.d/modules is empty
Perhaps some init script calls them?
Code: |
$> rc-update show
alsasound | boot
bootmisc | boot
consolefont | boot
dbus | default
devfs | sysinit
device-mapper | boot
dhcpcd | boot
dmesg | sysinit
fsck | boot
gpm | default
hostname | boot
hwclock | boot
keymaps | boot
killprocs | shutdown
lm_sensors | default
local | default nonetwork
localmount | boot
modules | boot
mount-ro | shutdown
mtab | boot
net.eth0 | default
net.lo | boot
procfs | boot
root | boot
savecache | shutdown
swap | boot
sysctl | boot
syslog-ng | default
termencoding | boot |
kernel: 3.3.8-gentoo _________________ Vanitas vanitatum et omnia vanitas.
Libera temet ex inferis. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sat Jul 21, 2012 2:16 pm Post subject: |
|
|
jimmij ...
simply add the modules to /etc/modprobe.d/blacklist.conf eg:
Code: | blacklist bluetooth |
best ... khay |
|
Back to top |
|
|
jimmij Tux's lil' helper
Joined: 02 Dec 2008 Posts: 143
|
Posted: Sat Jul 21, 2012 4:24 pm Post subject: |
|
|
Yes... this is some solution, but I would prefer to understand what is going on. _________________ Vanitas vanitatum et omnia vanitas.
Libera temet ex inferis. |
|
Back to top |
|
|
Gusar Advocate
Joined: 09 Apr 2005 Posts: 2665 Location: Slovenia
|
Posted: Sat Jul 21, 2012 4:57 pm Post subject: |
|
|
It's the magic of hardware detection. The kernel knows you have a webcam, so it loads the appropriate module. Well, it's actually udev that loads the module, but because the kernel has told it a webcam is there. Now, before you ask why virtualbox modules aren't loaded automatically... well, virtualbox isn't a hardware device, so the kernel/udev combo that works for those can't work for virtualbox. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sat Jul 21, 2012 6:06 pm Post subject: |
|
|
jimmij wrote: | Yes... this is some solution, but I would prefer to understand what is going on. |
jimmij ... you didn't ask for a tutorial but "how to prevent autoloading modules" and I answered that question, so "eyerolls".
khay |
|
Back to top |
|
|
jimmij Tux's lil' helper
Joined: 02 Dec 2008 Posts: 143
|
Posted: Sat Jul 21, 2012 8:26 pm Post subject: |
|
|
Gusar wrote: | It's the magic of hardware detection. The kernel knows you have a webcam, so it loads the appropriate module. Well, it's actually udev that loads the module, but because the kernel has told it a webcam is there. |
Oh, I see, that makes sense...
So another question: how can I politely ask udev and/or kernel to not load any modules without my explicit order?
I hope there is better (more general) rule than adding them one by one to the blacklist. _________________ Vanitas vanitatum et omnia vanitas.
Libera temet ex inferis. |
|
Back to top |
|
|
Gusar Advocate
Joined: 09 Apr 2005 Posts: 2665 Location: Slovenia
|
Posted: Sat Jul 21, 2012 8:45 pm Post subject: |
|
|
jimmij wrote: | So another question: how can I politely ask udev and/or kernel to not load any modules without my explicit order? |
I'm not aware of anything, as that's kinda the point of udev. You could not use udev, but honestly, that's way more hassle than simply creating a few blacklist entries. |
|
Back to top |
|
|
mv Watchman
Joined: 20 Apr 2005 Posts: 6780
|
Posted: Sun Jul 22, 2012 6:49 am Post subject: |
|
|
Gusar wrote: | that's way more hassle than simply creating a few blacklist entries. |
I suppose that blacklist entries will prevent you from loading the module later manually.
I think the clean way is to put your own udev rule for the corresponding device in /etc/udev/rules.d which does nothing but to stop the later rules from being run. (I do not remember without reading the udev documentation how this is done, but I remember that this is possible) |
|
Back to top |
|
|
olek Apprentice
Joined: 22 Oct 2011 Posts: 173
|
Posted: Sun Jul 22, 2012 8:40 am Post subject: |
|
|
@mv
You are able to load them manually, blacklisted modules just don't get auto-loaded. _________________ https://plaintext.blog |
|
Back to top |
|
|
|