I'm using a 2.6 kernel and udev.
In another thread [http://bbs.archlinux.org/viewtopic.php?t=11851] I've just learnt that hotplug isn't loading a module necessary to successfully handle a cd-rom drive. One easy way to go about it is to include the module in the MODULES list in /etc/rc.conf, eg,
MODULES = (ide-cd)
but I was wondering whether there is a way to tell hotplug how to load it on-demand? Since my machine is a laptop where the cd-rom drive is present perhaps 10% of the time, it doesn't make much sense to always have that module loaded...
I took a look at the modprobe.conf manpage, but that file seems to be mainly used to do additional things (or change how things are done) *when a module is (un)loaded*; what should I do if I want the system to load a module when a certain device is present?
Unfortunately, the last time I used Linux on my main computer the hotplug project didn't even exist! : ) So please bear with my "old man's" questions...
Thank you for any help
The idea is that when hardware is plugged in, it will generate some event which tells the kernel that something was added. That event would be handled by hotplug and passed on to the userspace hotplug tools. But if adding the cdrom drive isn't visible for the kernel, then hotplug can't work. The problem here is that udev (which uses hotplug events) won't make the device node in /dev, and hotplug won't load the needed module, so you can't use it.
So it boils down to that only you know that you added the cdrom, and nothing can be done automatically (not counting ugly polling). Though in the other thread you say that dmesg shows that it was detected, and then it becomes muddy.
Actually, thinking it over, perhaps the following is what happens:
Hotplug detects an IDE device and prints the info about it which it gets from the device, but it doesn't really know that it is a cdrom. As it already loaded the IDE modules (or they're build in), from hotplug's point of view nothing needs to be done. Or there is a hotplug event generated but not handled properly..
You can try to find what exactly goes wrong and why it doesn't work, or go the easy way and just always load ide-cd, it isn't that big. There are probably other ways too to autoload the module and what not when you try to access it, but the question is if that is easier or better than the simple way.
If you do want to track this down then first find out if there is a hotplug event generated, and if it is, why the correct module isn't loaded. Posting bigger parts of dmesg outputs may be helpful too, and the kernel version running etc.
Thank you for the explanation, I now have a better understanding of how hotplug/udev work together.
Yes, I guess I'll just go the easy route... : )