udev

from Wikipedia, the free encyclopedia
udev

Logo by udev
Basic data

developer Greg Kroah-Hartman , Kay Sievers , Dan Stekloff u. v. a
Current  version 246
( July 30, 2020 )
operating system GNU / Linux
programming language C.
category File system
License GPL
German speaking No
git.kernel.org/?p=linux/hotplug/udev.git

udev is userspace / dev ( / dev is device file ; see Engl. device = device) and is a program with which the Linux kernel manages device files for data input and output (I / O).

Since the 2.6 kernel, udev has replaced the previously used devfs file system, whose tasks it takes over. Just like devfs, udev manages the / dev directory, which contains the special device files, in order to access the devices made available by the system from programs.

With the introduction of udev, both udev and devfs were included in the kernel. Since the end of June 2006 only udev has been included, devfs has been completely removed.

On April 3, 2012, udev was included in systemd on the grounds that hotplugging was an integral part of systemd and that the administrative effort of both projects and redundant code could be reduced by a merge . udev became part of systemd 183.

Working method

udev monitors and evaluates hotplug events. If information about a newly connected device is found there, additional information available for this device is taken from the sysfs file system and a new device file is created in the / dev directory. The name used for the special file and the access authorization can be freely configured using rules.

configuration

If you install udev, you will find the standard rules under /etc/udev/rules.d/50-udev.rules. In order to be able to use your own rules, you should not change this file, but create a newer one with a smaller number, for example /etc/udev/rules.d/10-udev.rules. This ensures that these rules are recognized first. If a rule has been found, it will be applied, as will any suitable following rule.

advantages

In contrast to devfs, which was integrated in the Linux kernel itself, udev works in userspace , i.e. is started as a normal program. The administration and naming of the connected devices is no longer up to the kernel and is therefore easier to configure.

Further advantages are:

  • the assignment of devices is clear - there are no more problems if you z. B. changes the order of two connected USB printers
  • the naming of the devices can be chosen by the user; it remains constant
  • Any method can be used to determine the device name, in addition to static lists and rules, e.g. B. also the query of an external database, whereby, for example, devices within a company network - identified by their serial number - behave uniformly
  • the naming conforms to Linux-Standard-Base

disadvantage

A deliberately considered disadvantage of udev is that, unlike devfs, it does not automatically load the appropriate device drivers when a / dev node is called. If the HotPlug does not work properly when a device is plugged in and does not load the required drivers, these cannot be reloaded with udev.

Web links

Individual evidence

  1. Release 246 . July 30, 2020 (accessed July 31, 2020).
  2. ^ The udev Open Source Project on Open Hub: Languages ​​Page . In: Open Hub . (accessed on September 3, 2018).
  3. Kay Sievers: Udev and systemd to merge. April 3, 2012, accessed June 2, 2012 .
  4. Kay Sievers: Commit: import udev repository. April 3, 2012, accessed June 2, 2012 .
  5. systemd / systemd. In: GitHub. Retrieved August 21, 2016 .