[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: the mysteries of modprobe.d



On Mon, 07 Feb 2005 05:30:09 +0100, briand wrote:
> autoload the snd-intel8x0 module when required.


$ ls -l /dev/snd/pcmC0D0p
crw-rw----  1 root audio 116, 16 2005-02-10 19:40 /dev/snd/pcmC0D0p

* Application tries to open /dev/snd/pcmC0D0p
* Kernel sees that no module has registered to handle character
  device major number 116, so it modprobes char-major-116[0]
* modprobe sees in /etc/modprobe.d/alsa-base that char-major-116
  is aliased to snd;[0]
* modprobe loads snd
* snd modprobes snd-card-0, snd-card-1, ..., snd-card-8
* modprobe sees in /etc/modprobe.d/sound that snd-card-0 is
  aliased to snd-cs46xx or whatever


If you are using udev then you can't autoload modules because the device
files mentioned in the first step don't exist before the modules that
drive them are loaded.

devfs would be in the same pickle if it didn't have special code that
noticed when an application was trying to open a device file that doesn't
exist.

[0] Apparently this isn't really true any more for 2.6 kernels.  For
2.6 kernels, when a character device with major number 116 is opened, the
kernel modprobes snd directly.

-- 
Thomas Hood



Reply to: