depmod: export static device node information to modules.devname
To be able to let udev support kernel module on-demand loading, the next
kernel will export:
alias: devname:<name>
for some well-defined common kernel modules. This will let the kernel call
modprobe when the device node is accessed, the subsystem/driver will be
initialized and the open() of the device node will magically succeed.
The static device node aliases will be carried in the module itself. depmod
extracts this information:
$ cat /lib/modules/
2.6.34-00650-g537b60d-dirty/modules.devname
# Device nodes to trigger on-demand module loading.
microcode cpu/microcode c10:184
fuse fuse c10:229
ppp_generic ppp c108:0
tun net/tun c10:200
dm_mod mapper/control c10:235
Udev will pick up the depmod created file on startup and create all the
static device nodes which the kernel modules specify, so that these modules
get automatically loaded when the device node is accessed:
$ /sbin/udevd --debug
...
static_dev_create_from_modules: mknod '/dev/cpu/microcode' c10:184
static_dev_create_from_modules: mknod '/dev/fuse' c10:229
static_dev_create_from_modules: mknod '/dev/ppp' c108:0
static_dev_create_from_modules: mknod '/dev/net/tun' c10:200
static_dev_create_from_modules: mknod '/dev/mapper/control' c10:235
udev_rules_apply_static_dev_perms: chmod '/dev/net/tun' 0666
udev_rules_apply_static_dev_perms: chmod '/dev/fuse' 0666
Signed-off-by: Jon Masters <jcm@jonmasters.org>