Check out my first novel, midnight's simulacra!

Udev: Difference between revisions

From dankwiki
m (1 revision)
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
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 [http://www.atnf.csiro.au/people/rgooch/linux/docs/devfs.html devfs], a turn-of-the-century abortion birthed by [http://www.atnf.csiro.au/people/rgooch/linux/kernel-patches.html Richard Gooch] (for details on this gory struggle (long since settled in udev's favor), see Greg Kroah-Hartman's whitepaper, '[http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev_vs_devfs 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 [http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;hb=HEAD;f=README kernel documentation])) and a userspace daemon (<tt>udevd</tt>) plus its configuration.
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 [http://www.atnf.csiro.au/people/rgooch/linux/docs/devfs.html devfs], a turn-of-the-century abortion birthed by [http://www.atnf.csiro.au/people/rgooch/linux/kernel-patches.html Richard Gooch] (for details on this gory struggle (long since settled in udev's favor), see Greg Kroah-Hartman's whitepaper, '[http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev_vs_devfs 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 [http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;hb=HEAD;f=README kernel documentation])) and a userspace daemon (<tt>udevd</tt>) plus its configuration.
==Interface naming==
==[[KVM]]==
On [[Debian]] (unstable, 2009-06-20), the default kvm/udev setup results in <tt>/dev/kvm</tt> have mode 0666 and ownership <tt>root:root</tt>, despite the creation of a <tt>kvm</tt> group. To have this file instead created with <tt>root:kvm</tt> ownership, add <tt>/etc/udev/rules.d/50-kvm.rules</tt> with the contents:<pre>KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660"</pre>I got this information from [https://bugs.launchpad.net/ubuntu/+source/kvm/+bug/127704 Ubuntu bug 127704], and have reported it to [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=493053 Debian bug 493053].
==CDROMs==
On [[Debian]] unstable, <tt>/etc/udev/rules.d/70-persistent-cd.rules</tt> 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==
<tt>udevadm monitor --environment kernel</tt>

Latest revision as of 13:13, 21 July 2011

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