Monday, February 2, 2009

/etc/udev/rules.d

Device files are no longer handled in a static way; they are now dynamically generated as needed. Previously a device file was created for each possible device, leading to a very large number of device files in the /etc/dev directory. Now your system detects only those devices it uses and creates device files for them, resulting in a much smaller listing of device files.

The tool used to detect and generate device files is udev, user devices. Each time your system
is booted, udev will automatically detect your devices and generate device files for them in the /etc/dev directory. This means that the /etc/dev directory and its files are re-created each time you boot. It is a dynamic directory, no longer static. To manage these device files, you need to use udev configuration files located in the /etc/udev directory. This means that udev is also able to manage all removable devices dynamically; udev will generate and configure device files for removable devices as they are attached and then remove these files when the devices are removed. In this sense, all devices are now considered hotplugged, with fixed devices simply being hotplugged devices that are never removed.

As /etc/dev is now dynamic, any changes you would make manually to the /etc/dev directory will be lost when you reboot. This includes the creation of any symbolic links such as /dev/cdrom that many software applications use. Instead, such symbolic links have to be configured using udev rules listed in configuration files located in the /etc/udev/rules.d directory. Default rules are already in place for symbolic links, but you can create rules of your own.

No comments:

Post a Comment