The Udev package contains programs for dynamic creation of device nodes.
Create some devices that Udev cannot handle due to them being required very early in the boot process:
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="extras/ata_id extras/cdrom_id extras/edd_id extras/firmware extras/floppy extras/scsi_id extras/usb_id extras/volume_id"
The meaning of the make option:
This builds several helper binaries that can aid in writing custom Udev rules.
To test the results, issue: make test.
Install the package:
make DESTDIR=/ \ EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id extras/firmware extras/floppy extras/scsi_id extras/usb_id extras/volume_id" \ 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's configuration is far from ideal by default, so install the configuration files here:
cp -v ../udev-config-5.rules /etc/udev/rules.d/25-lfs.rules
Alter Udev's configuration file so that Udev can automatically load kernel modules.
sed -i 147,150d /etc/udev/rules.d/25-lfs.rules
cat >> /etc/udev/rules.d/25-lfs.rules << EOF
# Rules to allow hotplugging of devices with modular drivers
ACTION=="add", SUBSYSTEM=="usb", MODALIAS=="*", \
RUN+="/sbin/modprobe $modalias"
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[07]", \
RUN+="/sbin/modprobe sd_mod"
EOF
Install the documentation that explains how to create Udev rules:
install -m644 -D -v docs/writing_udev_rules/index.html /usr/share/doc/udev-084/index.html
Run the udevstart program to create our full complement of device nodes.
/sbin/udevstart