chiark / gitweb /
update TODO
[elogind.git] / README
1 udev - Linux userspace device management
2
3 Integrating udev in the system has complex dependencies and may differ from
4 distribution to distribution. A system may not be able to boot up or work
5 reliably without a properly installed udev version. The upstream udev project
6 does not recommend replacing a distro's udev installation with the upstream
7 version.
8
9 The upstream udev project's set of default rules may require a most recent
10 kernel release to work properly. This is currently version 2.6.32.
11
12 Tools and rules shipped by udev are not public API and may change at any time.
13 Never call any private tool in /lib/udev from any external application; it might
14 just go away in the next release. Access to udev information is only offered
15 by udevadm and libudev. Tools and rules in /lib/udev and the entire contents of
16 the /run/udev directory are private to udev and do change whenever needed.
17
18 Requirements:
19   - Version 2.6.34 of the Linux kernel with sysfs, procfs, signalfd, inotify,
20     unix domain sockets, networking and hotplug enabled
21
22   - Some architectures might need a later kernel, that supports accept4(),
23     or need to backport the accept4() syscall wiring in the kernel.
24
25   - These options are needed:
26       CONFIG_HOTPLUG=y
27       CONFIG_UEVENT_HELPER_PATH=""
28       CONFIG_NET=y
29       CONFIG_UNIX=y
30       CONFIG_SYSFS=y
31       CONFIG_SYSFS_DEPRECATED*=n
32       CONFIG_PROC_FS=y
33       CONFIG_INOTIFY_USER=y
34       CONFIG_SIGNALFD=y
35
36   - These options might be needed:
37       CONFIG_TMPFS=y
38       CONFIG_TMPFS_POSIX_ACL=y (user ACLs for device nodes)
39       CONFIG_BLK_DEV_BSG=y (SCSI devices)
40
41   - Udev does not work with the CONFIG_SYSFS_DEPRECATED* option.
42
43   - Unix domain sockets (CONFIG_UNIX) as a loadable kernel module may work,
44     but it is not supported.
45
46   - The deprecated hotplug helper /sbin/hotplug should be disabled in the
47     kernel configuration, it is not needed today, and may render the system
48     unusable because the kernel may create too many processes in parallel
49     so that the system runs out-of-memory.
50
51   - The proc filesystem must be mounted on /proc, and the sysfs filesystem must
52     be mounted at /sys. No other locations are supported by a standard
53     udev installation.
54
55   - The default rule sset requires the following group names resolvable at udev startup:
56       disk, cdrom, floppy, tape, audio, video, lp, tty, dialout, and kmem.
57     Especially in LDAP setups, it is required that getgrnam() be able to resolve
58     these group names with only the rootfs mounted and while no network is
59     available.
60
61   - Some udev extras have external dependencies like:
62       libacl, libglib2, usbutils, pciutils, and gperf.
63     All these extras can be disabled with configure options.
64
65 Setup:
66   - At bootup, the /dev directory should get the 'devtmpfs' filesystem
67     mounted. Udev manages the permissions and ownership of the kernel-created
68     device nodes, and udev possibly creates additional symlinks. If needed, udev also
69     works on an empty 'tmpfs' filesystem, but some device nodes like
70     /dev/null, /dev/console, /dev/kmsg should be created before udevd is started.
71
72   - The udev daemon should be started to handle device events sent by the kernel.
73     During bootup, the events for already existing devices can be replayed, so
74     that they are configured by udev. This is usually done by:
75       /sbin/udevadm trigger --action=add --type=subsystems
76       /sbin/udevadm trigger --action=add --type=devices
77
78   - Restarting the daemon never applies any rules to existing devices.
79
80   - New/changed rule files are picked up automatically; there is no daemon
81     restart or signal needed.
82
83 Operation:
84   - Based on events the kernel sends out on device creation/removal, udev
85     creates/removes device nodes and symlinks in the /dev directory.
86
87   - All kernel events are matched against a set of specified rules, which
88     possibly hook into the event processing and load required kernel
89     modules to set up devices. For all devices, the kernel exports a major/minor
90     number; if needed, udev creates a device node with the default kernel
91     device name. If specified, udev applies permissions/ownership to the device
92     node, creates additional symlinks pointing to the node, and executes
93     programs to handle the device.
94
95   - The events udev handles, and the information udev merges into its device
96     database, can be accessed with libudev:
97       http://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/
98       http://www.kernel.org/pub/linux/utils/kernel/hotplug/gudev/
99
100 For more details about udev and udev rules, see the udev man pages:
101       http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/
102
103 Please direct any comment/question to the linux-hotplug mailing list at:
104   linux-hotplug@vger.kernel.org