source: chapter06/udev.xml@ 61e63d3

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.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 61e63d3 was 61e63d3, checked in by Bryan Kadzban <bryan@…>, 16 years ago

Upgrade Udev to 122, udev-config to 20080522, and lfs-bootscripts to 20080522. Replace "write_net_rules all_interfaces" with a "udevadm test" loop. Fix several typos. Remove the usb_id segfault patch, as it's included in Udev now. Add /lib/udev/devices/kmsg, as udevd uses /dev/kmsg to log a message at startup. Replace udevtrigger/udevinfo with "udevadm trigger" and "udevadm info" in the text.

Should fix #2057, #2079, #2170, and #2186.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8545 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 <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, or by Udev itself:</para>
51
52<screen><userinput remap="install">install -dv /lib/{firmware,udev/devices/{pts,shm}}
53mknod -m0666 /lib/udev/devices/null c 1 3
54mknod -m0600 /lib/udev/devices/kmsg c 1 11
55ln -sv /proc/self/fd /lib/udev/devices/fd
56ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
57ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
58ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
59ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
60
61 <para>Compile the package:</para>
62
63<screen><userinput remap="make">make EXTRAS="`echo extras/*/`"</userinput></screen>
64
65 <variablelist>
66 <title>The meaning of the make option:</title>
67
68 <varlistentry>
69 <term><parameter>EXTRAS=...</parameter></term>
70 <listitem>
71 <para>This builds the helper binaries that can aid in writing custom
72 Udev rules.</para>
73 </listitem>
74 </varlistentry>
75
76 </variablelist>
77
78 <para>To test the results, issue:</para>
79
80<screen><userinput remap="test">make test</userinput></screen>
81
82 <para>Note that the Udev testsuite will produce numerous messages in
83 the host system's logs. These are harmless and can be ignored.</para>
84
85 <para>Install the package:</para>
86
87<screen><userinput remap="install">make DESTDIR=/ EXTRAS="`echo extras/*/`" install</userinput></screen>
88
89 <variablelist>
90 <title>The meaning of the make parameter:</title>
91
92 <varlistentry>
93 <term><parameter>DESTDIR=/</parameter></term>
94 <listitem>
95 <para>This prevents the Udev build process from killing any
96 <command>udevd</command> processes that may be running on the
97 host system.</para>
98 </listitem>
99 </varlistentry>
100
101 </variablelist>
102
103 <para>Udev has to be configured in order to work properly, as its default
104 configuration does not cover all devices. Install the (LFS-specific)
105 custom rules files:</para>
106
107<screen><userinput remap="install">cd &udev-config;
108make install</userinput></screen>
109
110 <para>Install the documentation that explains the LFS-specific rules
111 files:</para>
112
113<screen><userinput remap="install">make install-doc</userinput></screen>
114
115 <para>Install the documentation that explains the commonly-used rules
116 files provided by Udev:</para>
117
118<screen><userinput remap="install">make install-extra-doc</userinput></screen>
119
120 <para>Install the documentation that explains how to create custom Udev
121 rules:</para>
122
123<screen><userinput remap="install">cd ..
124install -dv /usr/share/doc/udev-&udev-version;
125install -m644 -v docs/writing_udev_rules/index.html \
126 /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
127
128 </sect2>
129
130 <sect2 id="contents-udev" role="content">
131 <title>Contents of Udev</title>
132
133 <segmentedlist>
134 <segtitle>Installed programs</segtitle>
135 <segtitle>Installed libraries</segtitle>
136 <segtitle>Installed directory</segtitle>
137
138 <seglistitem>
139 <seg>ata_id, cdrom_id, collect, create_floppy_devices, edd_id,
140 firmware.sh, fstab_import, path_id, scsi_id, udevadm, udevd,
141 usb_id, vol_id, write_cd_rules, and write_net_rules</seg>
142 <seg>libvolume_id</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="collect">
175 <term><command>collect</command></term>
176 <listitem>
177 <para>Given an ID for the current uevent and a list of
178 IDs (for all target uevents), registers the current ID
179 and indicates whether all target IDs have been registered</para>
180 <indexterm zone="ch-system-udev collect">
181 <primary sortas="b-collect">collect</primary>
182 </indexterm>
183 </listitem>
184 </varlistentry>
185
186 <varlistentry id="create_floppy_devices">
187 <term><command>create_floppy_devices</command></term>
188 <listitem>
189 <para>Creates all possible floppy devices based on the CMOS type</para>
190 <indexterm zone="ch-system-udev create_floppy_devices">
191 <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
192 </indexterm>
193 </listitem>
194 </varlistentry>
195
196 <varlistentry id="edd_id">
197 <term><command>edd_id</command></term>
198 <listitem>
199 <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
200 <indexterm zone="ch-system-udev edd_id">
201 <primary sortas="b-edd_id">edd_id</primary>
202 </indexterm>
203 </listitem>
204 </varlistentry>
205
206 <varlistentry id="firmware.sh">
207 <term><command>firmware.sh</command></term>
208 <listitem>
209 <para>Uploads firmware to devices</para>
210 <indexterm zone="ch-system-udev firmware.sh">
211 <primary sortas="b-firmware.sh">firmware.sh</primary>
212 </indexterm>
213 </listitem>
214 </varlistentry>
215
216 <varlistentry id="fstab_import">
217 <term><command>fstab_import</command></term>
218 <listitem>
219 <para>Finds an entry in <filename>/etc/fstab</filename> that
220 matches the current device, and provides its information to
221 Udev</para>
222 <indexterm zone="ch-system-udev fstab_import">
223 <primary sortas="b-fstab_import">fstab_import</primary>
224 </indexterm>
225 </listitem>
226 </varlistentry>
227
228 <varlistentry id="path_id">
229 <term><command>path_id</command></term>
230 <listitem>
231 <para>Provides the shortest possible unique hardware path to a
232 device</para>
233 <indexterm zone="ch-system-udev path_id">
234 <primary sortas="b-path_id">path_id</primary>
235 </indexterm>
236 </listitem>
237 </varlistentry>
238
239 <varlistentry id="scsi_id">
240 <term><command>scsi_id</command></term>
241 <listitem>
242 <para>Provides Udev with a unique SCSI identifier
243 based on the data returned from sending a SCSI INQUIRY command to
244 the specified device</para>
245 <indexterm zone="ch-system-udev scsi_id">
246 <primary sortas="b-scsi_id">scsi_id</primary>
247 </indexterm>
248 </listitem>
249 </varlistentry>
250
251 <varlistentry id="udevadm">
252 <term><command>udevadm</command></term>
253 <listitem>
254 <para>Generic udev administration tool: controls the udevd daemon,
255 provides info from the Udev database, monitors uevents, waits for
256 uevents to finish, tests Udev configuration, and triggers uevents
257 for a given device</para>
258 <indexterm zone="ch-system-udev udevadm">
259 <primary sortas="b-udevadm">udevadm</primary>
260 </indexterm>
261 </listitem>
262 </varlistentry>
263
264 <varlistentry id="udevd">
265 <term><command>udevd</command></term>
266 <listitem>
267 <para>A daemon that listens for uevents on the netlink socket,
268 creates devices and runs the configured external programs in
269 response to these uevents</para>
270 <indexterm zone="ch-system-udev udevd">
271 <primary sortas="b-udevd">udevd</primary>
272 </indexterm>
273 </listitem>
274 </varlistentry>
275
276 <varlistentry id="usb_id">
277 <term><command>usb_id</command></term>
278 <listitem>
279 <para>Provides Udev with information about USB
280 devices</para>
281 <indexterm zone="ch-system-udev usb_id">
282 <primary sortas="b-usb_id">usb_id</primary>
283 </indexterm>
284 </listitem>
285 </varlistentry>
286
287 <varlistentry id="vol_id">
288 <term><command>vol_id</command></term>
289 <listitem>
290 <para>Provides Udev with the label and uuid of a
291 filesystem</para>
292 <indexterm zone="ch-system-udev vol_id">
293 <primary sortas="b-vol_id">vol_id</primary>
294 </indexterm>
295 </listitem>
296 </varlistentry>
297
298 <varlistentry id="write_cd_rules">
299 <term><command>write_cd_rules</command></term>
300 <listitem>
301 <para>A script which generates Udev rules to provide stable names for
302 optical drives (see also <xref linkend="ch-scripts-symlinks"/>)</para>
303 <indexterm zone="ch-system-udev write_cd_rules">
304 <primary sortas="b-write_cd_rules">write_cd_rules</primary>
305 </indexterm>
306 </listitem>
307 </varlistentry>
308
309 <varlistentry id="write_net_rules">
310 <term><command>write_net_rules</command></term>
311 <listitem>
312 <para>A script which generates rules to provide stable names for
313 network interfaces (see also <xref linkend="ch-scripts-network"/>)
314 </para>
315 <indexterm zone="ch-system-udev write_net_rules">
316 <primary sortas="b-write_net_rules">write_net_rules</primary>
317 </indexterm>
318 </listitem>
319 </varlistentry>
320
321 <varlistentry id="libvolume_id">
322 <term><command>libvolume_id</command></term>
323 <listitem>
324 <para></para>
325 <indexterm zone="ch-system-udev libvolume_id">
326 <primary sortas="c-libvolume_id">libvolume_id</primary>
327 </indexterm>
328 </listitem>
329 </varlistentry>
330
331 <varlistentry id="etc-udev">
332 <term><filename class="directory">/etc/udev</filename></term>
333 <listitem>
334 <para>Contains Udev configuration files,
335 device permissions, and rules for device naming</para>
336 <indexterm zone="ch-system-udev etc-udev">
337 <primary sortas="e-/etc/udev">/etc/udev</primary>
338 </indexterm>
339 </listitem>
340 </varlistentry>
341
342 </variablelist>
343
344 </sect2>
345
346</sect1>
Note: See TracBrowser for help on using the repository browser.