source: chapter06/udev.xml@ 615a565

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 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/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 615a565 was 408d21f, checked in by Matthew Burgess <matthew@…>, 17 years ago

Add a patch to fix a segfault in usb_id.

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

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