source: chapter06/udev.xml@ d439604

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 d439604 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
RevLine 
[9dfc02f]1<?xml version="1.0" encoding="ISO-8859-1"?>
[b06ca36]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[9dfc02f]4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
[ddd5542]7
[a001133]8<sect1 id="ch-system-udev" role="wrap">
[ddd5542]9 <?dbhtml filename="udev.html"?>
10
[e747759]11 <sect1info condition="script">
12 <productname>udev</productname>
13 <productnumber>&udev-version;</productnumber>
14 <address>&udev-url;</address>
15 </sect1info>
16
[ddd5542]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/>
[9dfc02f]25
[ddd5542]26 <para>The Udev package contains programs for dynamic creation of device
27 nodes.</para>
[9dfc02f]28
[ddd5542]29 <segmentedlist>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
[9dfc02f]32
[ddd5542]33 <seglistitem>
[e4a5635]34 <seg>&udev-ch6-sbu;</seg>
35 <seg>&udev-ch6-du;</seg>
[ddd5542]36 </seglistitem>
37 </segmentedlist>
[9dfc02f]38
[ddd5542]39 </sect2>
[9dfc02f]40
[ddd5542]41 <sect2 role="installation">
42 <title>Installation of Udev</title>
43
[7d6d34b]44 <para>The udev-config tarball contains LFS-specific files used to configure
[e1060de]45 Udev. Unpack it into the Udev source directory:</para>
[7d6d34b]46
[0445a3d]47<screen><userinput remap="pre">tar -xvf ../&udev-config;.tar.bz2</userinput></screen>
[7d6d34b]48
[d2c332bc]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
[2b596c0b]52<screen><userinput remap="install">install -dv /lib/{firmware,udev/devices/{pts,shm}}
[d2c332bc]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
[408d21f]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
[ddd5542]65 <para>Compile the package:</para>
[9dfc02f]66
[0445a3d]67<screen><userinput remap="make">make EXTRAS="`echo extras/*/`"</userinput></screen>
[81fd230]68
[ddd5542]69 <variablelist>
70 <title>The meaning of the make option:</title>
71
72 <varlistentry>
[d2c332bc]73 <term><parameter>EXTRAS=...</parameter></term>
[ddd5542]74 <listitem>
[8536c02]75 <para>This builds the helper binaries that can aid in writing custom
[d2c332bc]76 Udev rules.</para>
[ddd5542]77 </listitem>
78 </varlistentry>
[09043c0]79
[ddd5542]80 </variablelist>
[09043c0]81
[0445a3d]82 <para>To test the results, issue:</para>
83
84<screen><userinput remap="test">make test</userinput></screen>
[81fd230]85
[c226182]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
[ddd5542]89 <para>Install the package:</para>
[9dfc02f]90
[0445a3d]91<screen><userinput remap="install">make DESTDIR=/ EXTRAS="`echo extras/*/`" install</userinput></screen>
[09043c0]92
[ddd5542]93 <variablelist>
94 <title>The meaning of the make parameter:</title>
[09043c0]95
[ddd5542]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>
[9dfc02f]104
[ddd5542]105 </variablelist>
106
[23732c83]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
[dbfd971]109 commonly-used rules files provided by Udev:</para>
[18da154]110
[0445a3d]111<screen><userinput remap="install">cp -v etc/udev/rules.d/[0-9]* /etc/udev/rules.d/</userinput></screen>
[18da154]112
[dbfd971]113 <para>Now install the LFS-specific rules files:</para>
[7eac3e32]114
[0445a3d]115<screen><userinput remap="install">cd &udev-config;
[7e6fb44]116make install</userinput></screen>
117
118 <para>Install the documentation that explains the LFS-specific rules
119 files:</para>
120
[0445a3d]121<screen><userinput remap="install">make install-doc</userinput></screen>
[7e6fb44]122
[dbfd971]123 <para>Install the documentation that explains the commonly-used rules
124 files provided by Udev:</para>
[7e6fb44]125
[0445a3d]126<screen><userinput remap="install">make install-extra-doc</userinput></screen>
[7e6fb44]127
128 <para>Install the documentation that explains how to create custom Udev
129 rules:</para>
130
[0445a3d]131<screen><userinput remap="install">cd ..
[997a8b7]132install -m644 -v docs/writing_udev_rules/index.html \
[2c558d69]133 /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
[7eac3e32]134
[ddd5542]135 </sect2>
136
137 <sect2 id="contents-udev" role="content">
138 <title>Contents of Udev</title>
139
140 <segmentedlist>
141 <segtitle>Installed programs</segtitle>
[2791a8e]142 <segtitle>Installed libraries</segtitle>
[ddd5542]143 <segtitle>Installed directory</segtitle>
144
145 <seglistitem>
[2791a8e]146 <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware.sh,
[7d6d34b]147 path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle,
[2791a8e]148 udevtest, udevtrigger, usb_id, vol_id, write_cd_rules, and
149 write_net_rules</seg>
150 <seg>libvolume_id</seg>
[ddd5542]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
[d2c332bc]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>
[ddd5542]184 <listitem>
[d2c332bc]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>
[ddd5542]188 </indexterm>
189 </listitem>
190 </varlistentry>
191
[d2c332bc]192 <varlistentry id="edd_id">
193 <term><command>edd_id</command></term>
[ddd5542]194 <listitem>
[d2c332bc]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>
[ddd5542]198 </indexterm>
199 </listitem>
200 </varlistentry>
201
[2791a8e]202 <varlistentry id="firmware.sh">
203 <term><command>firmware.sh</command></term>
[ddd5542]204 <listitem>
[d2c332bc]205 <para>Uploads firmware to devices</para>
[2791a8e]206 <indexterm zone="ch-system-udev firmware.sh">
207 <primary sortas="b-firmware.sh">firmware.sh</primary>
[d2c332bc]208 </indexterm>
209 </listitem>
210 </varlistentry>
211
[7d6d34b]212 <varlistentry id="path_id">
213 <term><command>path_id</command></term>
214 <listitem>
[9058aa1]215 <para>Provides the shortest possible unique hardware path to a
[7d6d34b]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
[d2c332bc]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>
[ddd5542]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>
[d2c332bc]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>
[ddd5542]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>
[d2c332bc]261 <para>Allows users to query the Udev database for
[ddd5542]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>
[d2c332bc]275 <para>Prints the event received from the kernel and the environment
276 which Udev sends out after rule processing</para>
[ddd5542]277 <indexterm zone="ch-system-udev udevmonitor">
278 <primary sortas="b-udevmonitor">udevmonitor</primary>
279 </indexterm>
280 </listitem>
281 </varlistentry>
282
[7d6d34b]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
[d2c332bc]294 <varlistentry id="udevtest">
295 <term><command>udevtest</command></term>
[ddd5542]296 <listitem>
[d2c332bc]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>
[ddd5542]302 </indexterm>
303 </listitem>
304 </varlistentry>
305
[7d6d34b]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
[d2c332bc]316 <varlistentry id="usb_id">
317 <term><command>usb_id</command></term>
[ddd5542]318 <listitem>
[d2c332bc]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>
[ddd5542]323 </indexterm>
324 </listitem>
325 </varlistentry>
326
[d2c332bc]327 <varlistentry id="vol_id">
328 <term><command>vol_id</command></term>
[ddd5542]329 <listitem>
[d2c332bc]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>
[ddd5542]334 </indexterm>
335 </listitem>
336 </varlistentry>
337
[2791a8e]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
[ddd5542]371 <varlistentry id="etc-udev">
372 <term><filename class="directory">/etc/udev</filename></term>
373 <listitem>
[9058aa1]374 <para>Contains Udev configuration files,
[ddd5542]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>
[9dfc02f]385
386</sect1>
Note: See TracBrowser for help on using the repository browser.