source: chapter06/udev.xml@ ce33e575

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 12.2 12.2-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since ce33e575 was 1652151, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Fixes for PDF output.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8015 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 11.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-udev" role="wrap">
9 <?dbhtml filename="udev.html"?>
10
11 <title>Udev-&udev-version;</title>
12
13 <indexterm zone="ch-system-udev">
14 <primary sortas="a-Udev">Udev</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The Udev package contains programs for dynamic creation of device
21 nodes.</para>
22
23 <segmentedlist>
24 <segtitle>&buildtime;</segtitle>
25 <segtitle>&diskspace;</segtitle>
26
27 <seglistitem>
28 <seg>&udev-ch6-sbu;</seg>
29 <seg>&udev-ch6-du;</seg>
30 </seglistitem>
31 </segmentedlist>
32
33 </sect2>
34
35 <sect2 role="installation">
36 <title>Installation of Udev</title>
37
38 <para>The udev-config tarball contains LFS-specific files used to configure
39 Udev. Unpack it into the Udev source directory:</para>
40
41<screen><userinput>tar -xvf ../&udev-config;.tar.bz2</userinput></screen>
42
43 <para>Create some devices and directories that Udev cannot handle due to
44 them being required very early in the boot process:</para>
45
46<screen><userinput>install -dv /lib/{firmware,udev/devices/{pts,shm}}
47mknod -m0666 /lib/udev/devices/null c 1 3
48ln -sv /proc/self/fd /lib/udev/devices/fd
49ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
50ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
51ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
52ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
53
54 <para>Compile the package:</para>
55
56<screen><userinput>make EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
57 extras/firmware extras/floppy extras/path_id \
58 extras/rule_generator extras/scsi_id extras/usb_id \
59 extras/volume_id"</userinput></screen>
60
61 <variablelist>
62 <title>The meaning of the make option:</title>
63
64 <varlistentry>
65 <term><parameter>EXTRAS=...</parameter></term>
66 <listitem>
67 <para>This builds several helper binaries that can aid in writing custom
68 Udev rules.</para>
69 </listitem>
70 </varlistentry>
71
72 </variablelist>
73
74 <para>To test the results, issue:
75 <userinput>make test</userinput>.</para>
76
77 <para>Note that the Udev testsuite will produce numerous messages in
78 the host system's logs. These are harmless and can be ignored.</para>
79
80 <para>Install the package:</para>
81
82<screen><userinput>make DESTDIR=/ \
83 EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
84 extras/firmware extras/floppy extras/path_id \
85 extras/rule_generator extras/scsi_id \
86 extras/usb_id extras/volume_id" install</userinput></screen>
87
88 <variablelist>
89 <title>The meaning of the make parameter:</title>
90
91 <varlistentry>
92 <term><parameter>DESTDIR=/</parameter></term>
93 <listitem>
94 <para>This prevents the Udev build process from killing any
95 <command>udevd</command> processes that may be running on the
96 host system.</para>
97 </listitem>
98 </varlistentry>
99
100 </variablelist>
101
102 <para>Udev has to be configured in order to work properly, as it only
103 installs a few configuration files by default. First install the
104 commonly-used rules files provided by Udev:</para>
105
106<screen><userinput>cp -v etc/udev/rules.d/[0-9]* /etc/udev/rules.d/</userinput></screen>
107
108 <para>Now install the LFS-specific rules files:</para>
109
110<screen><userinput>cd &udev-config;
111make install</userinput></screen>
112
113 <para>Install the documentation that explains the LFS-specific rules
114 files:</para>
115
116<screen><userinput>make install-doc</userinput></screen>
117
118 <para>Install the documentation that explains the commonly-used rules
119 files provided by Udev:</para>
120
121<screen><userinput>make install-extra-doc</userinput></screen>
122
123 <para>Install the documentation that explains how to create custom Udev
124 rules:</para>
125
126<screen><userinput>cd ..
127install -m644 -v docs/writing_udev_rules/index.html \
128 /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
129
130 </sect2>
131
132 <sect2 id="contents-udev" role="content">
133 <title>Contents of Udev</title>
134
135 <segmentedlist>
136 <segtitle>Installed programs</segtitle>
137 <segtitle>Installed directory</segtitle>
138
139 <seglistitem>
140 <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware_helper,
141 path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle,
142 udevtest, udevtrigger, usb_id, vol_id, and write_cd_aliases</seg>
143 <seg>/etc/udev</seg>
144 </seglistitem>
145 </segmentedlist>
146
147 <variablelist>
148 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
149 <?dbfo list-presentation="list"?>
150 <?dbhtml list-presentation="table"?>
151
152 <varlistentry id="ata_id">
153 <term><command>ata_id</command></term>
154 <listitem>
155 <para>Provides Udev with a unique string and
156 additional information (uuid, label) for an ATA drive</para>
157 <indexterm zone="ch-system-udev ata_id">
158 <primary sortas="b-ata_id">ata_id</primary>
159 </indexterm>
160 </listitem>
161 </varlistentry>
162
163 <varlistentry id="cdrom_id">
164 <term><command>cdrom_id</command></term>
165 <listitem>
166 <para>Provides Udev with the capabilities of a
167 CD-ROM or DVD-ROM drive</para>
168 <indexterm zone="ch-system-udev cdrom_id">
169 <primary sortas="b-cdrom_id">cdrom_id</primary>
170 </indexterm>
171 </listitem>
172 </varlistentry>
173
174 <varlistentry id="create_floppy_devices">
175 <term><command>create_floppy_devices</command></term>
176 <listitem>
177 <para>Creates all possible floppy devices based on the CMOS type</para>
178 <indexterm zone="ch-system-udev create_floppy_devices">
179 <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
180 </indexterm>
181 </listitem>
182 </varlistentry>
183
184 <varlistentry id="edd_id">
185 <term><command>edd_id</command></term>
186 <listitem>
187 <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
188 <indexterm zone="ch-system-udev edd_id">
189 <primary sortas="b-edd_id">edd_id</primary>
190 </indexterm>
191 </listitem>
192 </varlistentry>
193
194 <varlistentry id="firmware_helper">
195 <term><command>firmware_helper</command></term>
196 <listitem>
197 <para>Uploads firmware to devices</para>
198 <indexterm zone="ch-system-udev firmware_helper">
199 <primary sortas="b-firmware_helper">firmware_helper</primary>
200 </indexterm>
201 </listitem>
202 </varlistentry>
203
204 <varlistentry id="path_id">
205 <term><command>path_id</command></term>
206 <listitem>
207 <para>Provide the shortest possible unique hardware path to a
208 device</para>
209 <indexterm zone="ch-system-udev path_id">
210 <primary sortas="b-path_id">path_id</primary>
211 </indexterm>
212 </listitem>
213 </varlistentry>
214
215 <varlistentry id="scsi_id">
216 <term><command>scsi_id</command></term>
217 <listitem>
218 <para>Provides Udev with a unique SCSI identifier
219 based on the data returned from sending a SCSI INQUIRY command to
220 the specified device</para>
221 <indexterm zone="ch-system-udev scsi_id">
222 <primary sortas="b-scsi_id">scsi_id</primary>
223 </indexterm>
224 </listitem>
225 </varlistentry>
226
227 <varlistentry id="udevcontrol">
228 <term><command>udevcontrol</command></term>
229 <listitem>
230 <para>Configures a number of options for the running
231 <command>udevd</command> daemon, such as the log level.</para>
232 <indexterm zone="ch-system-udev udevcontrol">
233 <primary sortas="b-udevcontrol">udevcontrol</primary>
234 </indexterm>
235 </listitem>
236 </varlistentry>
237
238 <varlistentry id="udevd">
239 <term><command>udevd</command></term>
240 <listitem>
241 <para>A daemon that listens for uevents on the netlink socket,
242 creates devices and runs the configured external programs in
243 response to these uevents</para>
244 <indexterm zone="ch-system-udev udevd">
245 <primary sortas="b-udevd">udevd</primary>
246 </indexterm>
247 </listitem>
248 </varlistentry>
249
250 <varlistentry id="udevinfo">
251 <term><command>udevinfo</command></term>
252 <listitem>
253 <para>Allows users to query the Udev database for
254 information on any device currently present on the system; it also
255 provides a way to query any device in the <systemitem
256 class="filesystem">sysfs</systemitem> tree to help create udev
257 rules</para>
258 <indexterm zone="ch-system-udev udevinfo">
259 <primary sortas="b-udevinfo">udevinfo</primary>
260 </indexterm>
261 </listitem>
262 </varlistentry>
263
264 <varlistentry id="udevmonitor">
265 <term><command>udevmonitor</command></term>
266 <listitem>
267 <para>Prints the event received from the kernel and the environment
268 which Udev sends out after rule processing</para>
269 <indexterm zone="ch-system-udev udevmonitor">
270 <primary sortas="b-udevmonitor">udevmonitor</primary>
271 </indexterm>
272 </listitem>
273 </varlistentry>
274
275 <varlistentry id="udevsettle">
276 <term><command>udevsettle</command></term>
277 <listitem>
278 <para>Watches the Udev event queue and exits if all current uevents
279 have been handled</para>
280 <indexterm zone="ch-system-udev udevsettle">
281 <primary sortas="b-udevsettle">udevsettle</primary>
282 </indexterm>
283 </listitem>
284 </varlistentry>
285
286 <varlistentry id="udevtest">
287 <term><command>udevtest</command></term>
288 <listitem>
289 <para>Simulates a uevent for the given device, and prints out the
290 name of the node the real <command>udevd</command> would have created,
291 or the name of the renamed network interface</para>
292 <indexterm zone="ch-system-udev udevtest">
293 <primary sortas="b-udevtest">udevtest</primary>
294 </indexterm>
295 </listitem>
296 </varlistentry>
297
298 <varlistentry id="udevtrigger">
299 <term><command>udevtrigger</command></term>
300 <listitem>
301 <para>Triggers kernel device uevents to be replayed</para>
302 <indexterm zone="ch-system-udev udevtrigger">
303 <primary sortas="b-udevtrigger">udevtrigger</primary>
304 </indexterm>
305 </listitem>
306 </varlistentry>
307
308 <varlistentry id="usb_id">
309 <term><command>usb_id</command></term>
310 <listitem>
311 <para>Provides Udev with information about USB
312 devices</para>
313 <indexterm zone="ch-system-udev usb_id">
314 <primary sortas="b-usb_id">usb_id</primary>
315 </indexterm>
316 </listitem>
317 </varlistentry>
318
319 <varlistentry id="vol_id">
320 <term><command>vol_id</command></term>
321 <listitem>
322 <para>Provides Udev with the label and uuid of a
323 filesystem</para>
324 <indexterm zone="ch-system-udev vol_id">
325 <primary sortas="b-vol_id">vol_id</primary>
326 </indexterm>
327 </listitem>
328 </varlistentry>
329
330 <varlistentry id="etc-udev">
331 <term><filename class="directory">/etc/udev</filename></term>
332 <listitem>
333 <para>Contains Udev configuation files,
334 device permissions, and rules for device naming</para>
335 <indexterm zone="ch-system-udev etc-udev">
336 <primary sortas="e-/etc/udev">/etc/udev</primary>
337 </indexterm>
338 </listitem>
339 </varlistentry>
340
341 </variablelist>
342
343 </sect2>
344
345</sect1>
Note: See TracBrowser for help on using the repository browser.