6.60. Udev-181

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

Approximate build time: 0.2 SBU
Required disk space: 9.3 MB

6.60.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-20100128.tar.bz2

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

install -dv /lib/{firmware,udev/devices/pts}
mknod -m0666 /lib/udev/devices/null c 1 3

Prepare the package for compilation:

BLKID_CFLAGS="-I/usr/include/blkid"  \
BLKID_LIBS="-L/lib -lblkid"          \
KMOD_CFLAGS="-I/usr/include"         \
KMOD_LIBS="-L/lib -lkmod"            \
./configure  --prefix=/usr           \
             --with-rootprefix=''    \
             --bindir=/sbin          \
             --sysconfdir=/etc       \
             --libexecdir=/lib       \
             --enable-rule_generator \
             --disable-introspection \
             --disable-keymap        \
             --disable-gudev         \
             --with-usb-ids-path=no  \
             --with-pci-ids-path=no  \
             --with-systemdsystemunitdir=no

The meaning of the new configure options

--libexecdir=/lib

This controls where Udev-internal rules and helper programs are installed.

--enable-rule_generator

This allows persistent rules to be generated for network and optical media devices

--disable-* and --with-*

These options prevent Udev from installing helper programs and other extras which require more external libraries. These libraries are not part of the base LFS system. See the Udev README file for more information.

Compile the package:

make

Test the package.

make check

Install the package:

make install

Remove an empty documentation directory:

rmdir -v /usr/share/doc/udev

Now install the LFS-specific custom rules files:

cd udev-config-20100128
make install

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

make install-doc

6.60.2. Contents of Udev

Installed programs: ata_id, cdrom_id, collect, create_floppy_devices, edd_id, firmware.sh, fstab_import, path_id, scsi_id, udevadm, udevd, usb_id, write_cd_rules, and write_net_rules
Installed libraries: libudev.{a,so}
Installed directories: /etc/udev, /lib/udev, /lib/firmware, /usr/share/doc/udev-config, /usr/share/gtk-doc/html/libudev

Short Descriptions

ata_id

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

cdrom_id

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

collect

Given an ID for the current uevent and a list of IDs (for all target uevents), registers the current ID and indicates whether all target IDs have been registered

create_floppy_devices

Creates all possible floppy devices based on the CMOS type

edd_id

Provides Udev with the EDD ID for a BIOS disk drive

firmware.sh

Uploads firmware to devices

fstab_import

Finds an entry in /etc/fstab that matches the current device, and provides its information to Udev

path_id

Provides the shortest possible unique hardware path to a device

scsi_id

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

udevadm

Generic udev administration tool: controls the udevd daemon, provides info from the Udev database, monitors uevents, waits for uevents to finish, tests Udev configuration, and triggers uevents for a given device

udevd

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

usb_id

Provides Udev with information about USB devices

write_cd_rules

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

write_net_rules

A script which generates rules to provide stable names for network interfaces (see also Section 7.2, “General Network Configuration”)

libudev

A library interface to udev device information

/etc/udev

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