]> git.ipfire.org Git - thirdparty/systemd.git/blame - README
keymap: Support for microphone mute button on ThinkPad X220 et al
[thirdparty/systemd.git] / README
CommitLineData
eea1fd84 1udev - Linux userspace device management
c2df8b5f 2
eea1fd84
KS
3Integrating udev in the system has complex dependencies and may differ from
4distribution to distribution. A system may not be able to boot up or work
5reliably without a properly installed udev version. The upstream udev project
a2ddee73 6does not recommend replacing a distro's udev installation with the upstream
eea1fd84
KS
7version.
8
9The upstream udev project's set of default rules may require a most recent
67a77c8b 10kernel release to work properly. This is currently version 2.6.32.
c2df8b5f 11
0f50d0ef 12Tools and rules shipped by udev are not public API and may change at any time.
9698e70c 13Never call any private tool in /lib/udev from any external application; it might
0f50d0ef 14just go away in the next release. Access to udev information is only offered
600b2584
MW
15by udevadm and libudev. Tools and rules in /lib/udev and the entire contents of
16the /dev/.udev directory are private to udev and do change whenever needed.
c2df8b5f 17
c249f66a 18Requirements:
e3c14a7f 19 - Version 2.6.34 of the Linux kernel with sysfs, procfs, signalfd, inotify,
67a77c8b
KS
20 unix domain sockets, networking and hotplug enabled
21
ab7863f7
KS
22 - Some architectures might need a later kernel, that supports accept4(),
23 or need to backport the accept4() syscall wiring in the kernel.
67a77c8b
KS
24
25 - These options are needed:
262d5cca
KS
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
1da6c797 33 CONFIG_INOTIFY_USER=y
98ad80f8 34 CONFIG_SIGNALFD=y
67a77c8b
KS
35
36 - These options might be needed:
37 CONFIG_TMPFS=y
e4c02c1c 38 CONFIG_TMPFS_POSIX_ACL=y (user ACLs for device nodes)
a6c5b514 39 CONFIG_BLK_DEV_BSG=y (SCSI devices)
c2df8b5f 40
3fe44a29 41 - Udev does not work with the CONFIG_SYSFS_DEPRECATED* option.
1e03b754 42
a6c5b514
KS
43 - Unix domain sockets (CONFIG_UNIX) as a loadable kernel module may work,
44 but it is not supported.
c2df8b5f 45
eea1fd84
KS
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
bde1af68 51 - The proc filesystem must be mounted on /proc, and the sysfs filesystem must
eea1fd84
KS
52 be mounted at /sys. No other locations are supported by a standard
53 udev installation.
c2df8b5f 54
67a77c8b 55 - The default rule sset requires the following group names resolvable at udev startup:
bde1af68 56 disk, cdrom, floppy, tape, audio, video, lp, tty, dialout, and kmem.
47d9121c
MW
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
67c89548 59 available.
c249f66a 60
d5d6a7f3 61 - Some udev extras have external dependencies like:
1224944f 62 libacl, libglib2, libusb, usbutils, pciutils, and gperf.
d5d6a7f3 63 All these extras can be disabled with configure options.
c2df8b5f 64
eea1fd84
KS
65Setup:
66 - At bootup, the /dev directory should get the 'devtmpfs' filesystem
3fe44a29
MW
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
eea1fd84
KS
69 works on an empty 'tmpfs' filesystem, but some static device nodes like
70 /dev/null, /dev/console, /dev/kmsg are needed to be able to start udev itself.
c249f66a 71
eea1fd84
KS
72 - The udev daemon should be started to handle device events sent by the kernel.
73 During bootup, the kernel can be asked to send events for all already existing
e62c9c72 74 devices so that they too can be configured by udev. This is usually done by:
eea1fd84
KS
75 /sbin/udevadm trigger --type=subsystems
76 /sbin/udevadm trigger --type=devices
77
cb936a39 78 - Restarting the daemon never applies any rules to existing devices.
c2df8b5f 79
9698e70c 80 - New/changed rule files are picked up automatically; there is no daemon
eea1fd84
KS
81 restart or signal needed.
82
83Operation:
fd752623
MW
84 - Based on events the kernel sends out on device creation/removal, udev
85 creates/removes device nodes in the /dev directory.
eea1fd84
KS
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
49500e9b 89 modules to set up devices. For all devices, the kernel exports a major/minor
3fe44a29 90 number; if needed, udev creates a device node with the default kernel
eea1fd84
KS
91 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
d5d6a7f3
KS
100For more details about udev and udev rules, see the udev man pages:
101 http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/
c2df8b5f 102
a6c5b514 103Please direct any comment/question to the linux-hotplug mailing list at:
98520be7 104 linux-hotplug@vger.kernel.org