README revision 1224944f61d88d7e09010c808b117ce102c61ef9
71092d70af35567dd154d3de2ce04ce62e157a7cLennart Poetteringudev - Linux userspace device management
7c66aeba0f28cb82027d6015405ed71afa3b6059Kay SieversIntegrating udev in the system has complex dependencies and may differ from
c904f64d84db8c4eebedf210ba10893f19ba05edLennart Poetteringdistribution to distribution. A system may not be able to boot up or work
c904f64d84db8c4eebedf210ba10893f19ba05edLennart Poetteringreliably without a properly installed udev version. The upstream udev project
05677bb78079c3fa0283101aac2c07581f4873f1Lennart Poetteringdoes not recommend replacing a distro's udev installation with the upstream
f957632b960a0a42999b38ded7089fa602b41745Kay SieversThe upstream udev project's set of default rules may require a most recent
f957632b960a0a42999b38ded7089fa602b41745Kay Sieverskernel release to work properly. This is currently version 2.6.31.
9a36607584bbd1d78775353e022a51794b4e27b1Lennart PoetteringTools and rules shipped by udev are not public API and may change at any time.
9a36607584bbd1d78775353e022a51794b4e27b1Lennart PoetteringNever call any private tool in /lib/udev from any external application; it might
a40593a0d0d740efa387e35411e1e456a6c5aba7Lennart Poetteringjust go away in the next release. Access to udev information is only offered
20ffc4c4a9226b0e45cc02ad9c0108981626c0bbKay Sieversby udevadm and libudev. Tools and rules in /lib/udev and the entire contents of
4ce849853c46b1e857df3c6c9e7752159a58ddf1Lennart Poetteringthe /dev/.udev directory are private to udev and do change whenever needed.
c3090674833c8bd34fbdb0e743f1c47d85dd14fbLennart Poettering - Version 2.6.27 of the Linux kernel with sysfs, procfs, signalfd, inotify,
71092d70af35567dd154d3de2ce04ce62e157a7cLennart Poettering unix domain sockets, networking and hotplug enabled:
08f9588885c5d65694b324846b0ed19211d2c178Lennart Poettering CONFIG_HOTPLUG=y
a73d88fa024b5668ed7dde681e99547d41e6a864Lennart Poettering CONFIG_UEVENT_HELPER_PATH=""
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering CONFIG_SYSFS=y
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering CONFIG_SYSFS_DEPRECATED*=n
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering CONFIG_PROC_FS=y
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering CONFIG_TMPFS=y
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering CONFIG_INOTIFY_USER=y
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering CONFIG_SIGNALFD=y
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering CONFIG_TMPFS_POSIX_ACL=y (user ACLs for device nodes)
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering CONFIG_BLK_DEV_BSG=y (SCSI devices)
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering - Udev does not work with the CONFIG_SYSFS_DEPRECATED* option.
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering - Unix domain sockets (CONFIG_UNIX) as a loadable kernel module may work,
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering but it is not supported.
a19554ed92a7460b4e709cc40c558cde827ab85bLennart Poettering - The deprecated hotplug helper /sbin/hotplug should be disabled in the
1cb88f2c61f590083847d65cd5a518e834da87d3Lennart Poettering kernel configuration, it is not needed today, and may render the system
1cb88f2c61f590083847d65cd5a518e834da87d3Lennart Poettering unusable because the kernel may create too many processes in parallel
1cb88f2c61f590083847d65cd5a518e834da87d3Lennart Poettering so that the system runs out-of-memory.
1cb88f2c61f590083847d65cd5a518e834da87d3Lennart Poettering - The proc filesystem must be mounted on /proc, and the sysfs filesystem must
603cd8fe07cb03e8b11722d1a732e569e5a46347Lennart Poettering be mounted at /sys. No other locations are supported by a standard
06bf461193b4e7f9936abf7582e8b82e39e187c8Lennart Poettering udev installation.
06bf461193b4e7f9936abf7582e8b82e39e187c8Lennart Poettering - The system must have the following group names resolvable at udev startup:
06bf461193b4e7f9936abf7582e8b82e39e187c8Lennart Poettering disk, cdrom, floppy, tape, audio, video, lp, tty, dialout, and kmem.
936d6fcb6c4fc8839d28f8585af6ba733a7e1a1aLennart Poettering Especially in LDAP setups, it is required that getgrnam() be able to resolve
936d6fcb6c4fc8839d28f8585af6ba733a7e1a1aLennart Poettering these group names with only the rootfs mounted and while no network is
936d6fcb6c4fc8839d28f8585af6ba733a7e1a1aLennart Poettering - The 'udev extras' has the following dependencies:
936d6fcb6c4fc8839d28f8585af6ba733a7e1a1aLennart Poettering libacl, libglib2, libusb, usbutils, pciutils, and gperf.
936d6fcb6c4fc8839d28f8585af6ba733a7e1a1aLennart Poettering These dependencies can be disabled with the --disable-extras configure option.
936d6fcb6c4fc8839d28f8585af6ba733a7e1a1aLennart Poettering - At bootup, the /dev directory should get the 'devtmpfs' filesystem
936d6fcb6c4fc8839d28f8585af6ba733a7e1a1aLennart Poettering mounted. Udev manages the permissions and ownership of the kernel-created
ea117d4fde8b8d0b52f9d32ebd4bc09a5bd2ca8bLennart Poettering device nodes, and udev possibly creates additional symlinks. If needed, udev also
ea117d4fde8b8d0b52f9d32ebd4bc09a5bd2ca8bLennart Poettering works on an empty 'tmpfs' filesystem, but some static device nodes like
6d0274f11547a0f11200bb82bf598a5a253e12cfLennart Poettering /dev/null, /dev/console, /dev/kmsg are needed to be able to start udev itself.
6d0274f11547a0f11200bb82bf598a5a253e12cfLennart Poettering - The udev daemon should be started to handle device events sent by the kernel.
6d0274f11547a0f11200bb82bf598a5a253e12cfLennart Poettering During bootup, the kernel can be asked to send events for all already existing
a7a3f28be404875eff20443a0fa8088bcc4c18dfLennart Poettering devices, to apply the configuration to these devices. This is usually done by:
a7a3f28be404875eff20443a0fa8088bcc4c18dfLennart Poettering /sbin/udevadm trigger --type=subsystems
f530371f1f85a070d7d0fb5112146a43533ae00bLennart Poettering /sbin/udevadm trigger --type=devices
cfbc22abd0525570a6e58968d518ea9a7d0403baLennart Poettering - Restarting the daemon does never apply any rules to existing devices.
9a526a06bd22ccaf6641d11323fb04a0512a0e49Lennart Poettering - New/changed rule files are picked up automatically; there is no daemon
9a526a06bd22ccaf6641d11323fb04a0512a0e49Lennart Poettering restart or signal needed.
9b27910bb0c23e5225fc1177176e4f9bf9bf787bLennart Poettering - Udev creates/removes device nodes in /dev, based on events the kernel
9b27910bb0c23e5225fc1177176e4f9bf9bf787bLennart Poettering sends out on device creation/removal.
b03bfa212dd23397871e36ea32c35cdd8fe43506Lennart Poettering - All kernel events are matched against a set of specified rules, which
935fb723ba7370abaf793914fb5a722f7f5e41e1Lennart Poettering possibly hook into the event processing and load required kernel
b03bfa212dd23397871e36ea32c35cdd8fe43506Lennart Poettering modules to setup devices. For all devices the kernel exports a major/minor
b03bfa212dd23397871e36ea32c35cdd8fe43506Lennart Poettering number; if needed, udev creates a device node with the default kernel
b03bfa212dd23397871e36ea32c35cdd8fe43506Lennart Poettering name. If specified, udev applies permissions/ownership to the device
935fb723ba7370abaf793914fb5a722f7f5e41e1Lennart Poettering node, creates additional symlinks pointing to the node, and executes
08f9588885c5d65694b324846b0ed19211d2c178Lennart Poettering programs to handle the device.
7d8197d1f25c1291855bb6cffc705444978c6d8dKay Sievers - The events udev handles, and the information udev merges into its device
7d8197d1f25c1291855bb6cffc705444978c6d8dKay Sievers database, can be accessed with libudev:
7d8197d1f25c1291855bb6cffc705444978c6d8dKay Sievers http://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/
7d8197d1f25c1291855bb6cffc705444978c6d8dKay Sievers http://www.kernel.org/pub/linux/utils/kernel/hotplug/gudev/
7d8197d1f25c1291855bb6cffc705444978c6d8dKay SieversFor more details about udev and udev rules see the udev(7) man page.
9ee58bddeb6eb044753167e0047fe836479ca5dbKay SieversPlease direct any comment/question to the linux-hotplug mailing list at:
dcfc4b2e5c1af6375488c00bdc6fb8122f86c4d7Lennart Poettering linux-hotplug@vger.kernel.org