Udev

From dankwiki
Jump to: navigation, search

udev is introduced by the sparse website at http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html. It extended, superseded and utterly replaced devfs, a turn-of-the-century abortion birthed by Richard Gooch (for details on this gory struggle (long since settled in udev's favor), see Greg Kroah-Hartman's whitepaper, 'udev and devfs - the final word'. It implements device naming for Linux systems -- that is, maps kernel hardware entities to userspace keys. Furthermore, it emits low-level DBus messages; clients such as HAL can listen to these events and perform arbitrarily complex actions. udev is made up of both a kernel component (included in 2.6 Linux kernels; 2.6.19 is the minimum recommended version as of this writing (see the kernel documentation)) and a userspace daemon (udevd) plus its configuration.

Interface naming

KVM

On Debian (unstable, 2009-06-20), the default kvm/udev setup results in /dev/kvm have mode 0666 and ownership root:root, despite the creation of a kvm group. To have this file instead created with root:kvm ownership, add /etc/udev/rules.d/50-kvm.rules with the contents:
KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660"
I got this information from Ubuntu bug 127704, and have reported it to Debian bug 493053.

CDROMs

On Debian unstable, /etc/udev/rules.d/70-persistent-cd.rules maps ATA/SAS/SCSI bus IDs to symlinks. Moving a CD/DVD/BR drive will thus create a new symlink group (/dev/dvd1, /dev/cdrw1, etc).

Monitoring udev events

udevadm monitor --environment kernel