6.55. Udev-113

The Udev package contains programs for dynamic creation of device nodes.

Approximate build time: 0.1 SBU
Required disk space: 5.8 MB

6.55.1. Installation of Udev

The udev-config tarball contains LFS-specific files used to configure Udev. Unpack it into the Udev source directory:

tar -xvf ../udev-config-6.3.tar.bz2

Create some devices and directories that Udev cannot handle due to them being required very early in the boot process:

install -dv /lib/{firmware,udev/devices/{pts,shm}}
mknod -m0666 /lib/udev/devices/null c 1 3
ln -sv /proc/self/fd /lib/udev/devices/fd
ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
ln -sv /proc/kcore /lib/udev/devices/core

Compile the package:

make EXTRAS="`echo extras/*/`"

The meaning of the make option:


This builds the helper binaries that can aid in writing custom Udev rules.

To test the results, issue: make test.

Note that the Udev testsuite will produce numerous messages in the host system's logs. These are harmless and can be ignored.

Install the package:

make DESTDIR=/ EXTRAS="`echo extras/*/`" install

The meaning of the make parameter:


This prevents the Udev build process from killing any udevd processes that may be running on the host system.

Udev has to be configured in order to work properly, as it only installs a few configuration files by default. First install the commonly-used rules files provided by Udev:

cp -v etc/udev/rules.d/[0-9]* /etc/udev/rules.d/

Now install the LFS-specific rules files:

cd udev-config-6.3
make install

Install the documentation that explains the LFS-specific rules files:

make install-doc

Install the documentation that explains the commonly-used rules files provided by Udev:

make install-extra-doc

Install the documentation that explains how to create custom Udev rules:

cd ..
install -m644 -v docs/writing_udev_rules/index.html \

6.55.2. Contents of Udev

Installed programs: ata_id, cdrom_id, create_floppy_devices, edd_id, firmware.sh, path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle, udevtest, udevtrigger, usb_id, vol_id, write_cd_rules, and write_net_rules
Installed libraries: libvolume_id
Installed directory: /etc/udev

Short Descriptions


Provides Udev with a unique string and additional information (uuid, label) for an ATA drive


Provides Udev with the capabilities of a CD-ROM or DVD-ROM drive


Creates all possible floppy devices based on the CMOS type


Provides Udev with the EDD ID for a BIOS disk drive


Uploads firmware to devices


Provide the shortest possible unique hardware path to a device


Provides Udev with a unique SCSI identifier based on the data returned from sending a SCSI INQUIRY command to the specified device


Configures a number of options for the running udevd daemon, such as the log level.


A daemon that listens for uevents on the netlink socket, creates devices and runs the configured external programs in response to these uevents


Allows users to query the Udev database for information on any device currently present on the system; it also provides a way to query any device in the sysfs tree to help create udev rules


Prints the event received from the kernel and the environment which Udev sends out after rule processing


Watches the Udev event queue and exits if all current uevents have been handled


Simulates a uevent for the given device, and prints out the name of the node the real udevd would have created, or the name of the renamed network interface


Triggers kernel device uevents to be replayed


Provides Udev with information about USB devices


Provides Udev with the label and uuid of a filesystem


A script which generates Udev rules to provide stable names for optical drives (see also Section 7.12, “Creating Custom Symlinks to Devices”)


A script which generates rules to provide stable names for network interfaces (see also Section 7.13, “Configuring the network Script”)



Contains Udev configuation files, device permissions, and rules for device naming