]> git.ipfire.org Git - thirdparty/systemd.git/blame - README
autogen.sh: makedev() misteriously breaks with -O0 here, use -O1 for now
[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
57c6f8ae 10kernel release to work properly.
c2df8b5f 11
0f50d0ef 12Tools and rules shipped by udev are not public API and may change at any time.
12a362be
KS
13Never call any private tool in /usr/lib/udev from any external application; it
14might just go away in the next release. Access to udev information is only offered
15by udevadm and libudev. Tools and rules in /usr/lib/udev and the entire contents
16of the /run/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 24
57c6f8ae
KS
25 - These options are required:
26 CONFIG_DEVTMPFS=y
262d5cca 27 CONFIG_HOTPLUG=y
57c6f8ae 28 CONFIG_INOTIFY_USER=y
262d5cca 29 CONFIG_NET=y
262d5cca 30 CONFIG_PROC_FS=y
98ad80f8 31 CONFIG_SIGNALFD=y
57c6f8ae
KS
32 CONFIG_SYSFS=y
33 CONFIG_SYSFS_DEPRECATED*=n
34 CONFIG_UEVENT_HELPER_PATH=""
67a77c8b
KS
35
36 - These options might be needed:
a6c5b514 37 CONFIG_BLK_DEV_BSG=y (SCSI devices)
57c6f8ae
KS
38 CONFIG_TMPFS_POSIX_ACL=y (user ACLs for device nodes)
39
40 - The /dev directory needs the 'devtmpfs' filesystem mounted.
41 Udev only manages the permissions and ownership of the
42 kernel-provided device nodes, and possibly creates additional symlinks.
c2df8b5f 43
57c6f8ae
KS
44 - Udev requires /run to be writable, which is usually done by mounting a
45 'tmpfs' filesystem.
1e03b754 46
57c6f8ae
KS
47 - This version of udev does not work properly with the CONFIG_SYSFS_DEPRECATED*
48 option enabled.
c2df8b5f 49
eea1fd84
KS
50 - The deprecated hotplug helper /sbin/hotplug should be disabled in the
51 kernel configuration, it is not needed today, and may render the system
52 unusable because the kernel may create too many processes in parallel
53 so that the system runs out-of-memory.
54
bde1af68 55 - The proc filesystem must be mounted on /proc, and the sysfs filesystem must
eea1fd84
KS
56 be mounted at /sys. No other locations are supported by a standard
57 udev installation.
c2df8b5f 58
67a77c8b 59 - The default rule sset requires the following group names resolvable at udev startup:
bde1af68 60 disk, cdrom, floppy, tape, audio, video, lp, tty, dialout, and kmem.
47d9121c
MW
61 Especially in LDAP setups, it is required that getgrnam() be able to resolve
62 these group names with only the rootfs mounted and while no network is
67c89548 63 available.
c249f66a 64
d5d6a7f3 65 - Some udev extras have external dependencies like:
57c6f8ae 66 libglib2, usbutils, pciutils, and gperf.
d5d6a7f3 67 All these extras can be disabled with configure options.
c2df8b5f 68
eea1fd84 69Setup:
eea1fd84 70 - The udev daemon should be started to handle device events sent by the kernel.
afb9771b 71 During bootup, the events for already existing devices can be replayed, so
57c6f8ae
KS
72 that they are configured by udev. The systemd service files contain the
73 needed commands to start the udev daemon and the coldplug sequence.
eea1fd84 74
cb936a39 75 - Restarting the daemon never applies any rules to existing devices.
c2df8b5f 76
57c6f8ae
KS
77 - New/changed rule files are picked up automatically; there is usually no
78 daemon restart or signal needed.
eea1fd84
KS
79
80Operation:
fd752623 81 - Based on events the kernel sends out on device creation/removal, udev
afb9771b 82 creates/removes device nodes and symlinks in the /dev directory.
eea1fd84
KS
83
84 - All kernel events are matched against a set of specified rules, which
85 possibly hook into the event processing and load required kernel
49500e9b 86 modules to set up devices. For all devices, the kernel exports a major/minor
3fe44a29 87 number; if needed, udev creates a device node with the default kernel
afb9771b 88 device name. If specified, udev applies permissions/ownership to the device
eea1fd84
KS
89 node, creates additional symlinks pointing to the node, and executes
90 programs to handle the device.
91
92 - The events udev handles, and the information udev merges into its device
93 database, can be accessed with libudev:
94 http://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/
95 http://www.kernel.org/pub/linux/utils/kernel/hotplug/gudev/
96
d5d6a7f3
KS
97For more details about udev and udev rules, see the udev man pages:
98 http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/
c2df8b5f 99
a6c5b514 100Please direct any comment/question to the linux-hotplug mailing list at:
98520be7 101 linux-hotplug@vger.kernel.org