source: chapter06/udev.xml@ 9122ffe

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.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 9122ffe was 9122ffe, checked in by Bruce Dubbs <bdubbs@…>, 15 years ago

Update to util-linux-2.16, udev-145, e2fsprogs-1.41.8.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8959 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, 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>Prepare the package for compilation:</para>
62
63<!-- Note that "libdir=/usr/lib64" would be required for multilib. -->
64<screen><userinput remap="configure">./configure --prefix=/usr \
65 --sysconfdir=/etc --sbindir=/sbin \
66 --with-rootlibdir=/lib --libexecdir=/lib/udev \
67 --disable-extras</userinput></screen>
68
69 <variablelist>
70 <title>The meaning of the new configure options</title>
71
72 <varlistentry>
73 <term><parameter>--with-rootlibdir=/lib</parameter></term>
74 <listitem>
75 <para>This controls where the <filename
76 class="libraryfile">libudev</filename> library is installed. The
77 library needs to be in <filename class="directory">/lib</filename>
78 because it's used by Udev at boot time, before <filename
79 class="directory">/usr</filename> might be available, and the default
80 --rootlibdir is <filename class="directory">/usr/lib</filename>.</para>
81 </listitem>
82 </varlistentry>
83
84 <!-- Note that libexecdir *MUST* stay /lib/udev, even on a 64-bit
85 / multilib system where udev is compiled for 64-bit. Other
86 packages require this exact path; the udev maintainers have
87 said this is part of the udev API. -->
88 <varlistentry>
89 <term><parameter>--libexecdir=/lib/udev</parameter></term>
90 <listitem>
91 <para>This controls where Udev-internal rules and helper programs
92 are installed.</para>
93 </listitem>
94 </varlistentry>
95
96 <varlistentry>
97 <term><parameter>--disable-extras</parameter></term>
98 <listitem>
99 <para>This option prevents Udev from installing helper programs and
100 other extras which require more external libraries. These libraries
101 are not part of the base LFS system. See the Udev
102 <filename>README</filename> file for more information.</para>
103 </listitem>
104 </varlistentry>
105 </variablelist>
106
107 <para>Compile the package:</para>
108
109<screen><userinput remap="make">make</userinput></screen>
110
111 <para>This package does not come with a test suite.</para>
112
113 <para>Install the package:</para>
114
115<screen><userinput remap="install">make install</userinput></screen>
116
117 <para>Udev has to be configured in order to work properly, as its default
118 configuration does not cover all devices. First install two extra rules
119 files from Udev to help support device-mapper and RAID setups:</para>
120
121<screen><userinput remap="install">install -m644 -v rules/packages/64-*.rules \
122 /lib/udev/rules.d/</userinput></screen>
123
124 <para>Now install a file to create symlinks for certain hand-held devices:</para>
125
126<screen><userinput remap="install">install -m644 -v rules/packages/40-pilot-links.rules \
127 /lib/udev/rules.d/</userinput></screen>
128
129 <para>Now install a file to handle ISDN devices:</para>
130
131<screen><userinput remap="install">install -m644 -v rules/packages/40-isdn.rules \
132 /lib/udev/rules.d/</userinput></screen>
133
134 <!-- There are more files available in the packages/ directory, if we want
135 to consider using them. Most are probably irrelevant to LFS though.
136 "alsa" isn't, but we already have those rules, using a better set of
137 matches. Most of the files in packages/ are for other architectures. -->
138
139 <para>Now install the LFS-specific custom rules files:</para>
140
141<screen><userinput remap="install">cd &udev-config;
142make install</userinput></screen>
143
144 <para>Install the documentation that explains the LFS-specific rules
145 files:</para>
146
147<screen><userinput remap="install">make install-doc</userinput></screen>
148
149 <para>Install the documentation that explains the commonly-used rules
150 files provided by Udev:</para>
151
152<screen><userinput remap="install">make install-extra-doc</userinput></screen>
153<!--
154 <para>Install the documentation that explains how to create custom Udev
155 rules:</para>
156
157<screen><userinput remap="install">cd ..
158install -m644 -v -D docs/writing_udev_rules/index.html \
159 /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
160-->
161 </sect2>
162
163 <sect2 id="contents-udev" role="content">
164 <title>Contents of Udev</title>
165
166 <segmentedlist>
167 <segtitle>Installed programs</segtitle>
168 <segtitle>Installed libraries</segtitle>
169 <segtitle>Installed directory</segtitle>
170
171 <seglistitem>
172 <seg>ata_id, cdrom_id, collect, create_floppy_devices, edd_id,
173 firmware.sh, fstab_import, path_id, scsi_id, udevadm, udevd,
174 usb_id, write_cd_rules, and write_net_rules</seg>
175 <seg>libudev</seg>
176 <seg>/etc/udev</seg>
177 </seglistitem>
178 </segmentedlist>
179
180 <variablelist>
181 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
182 <?dbfo list-presentation="list"?>
183 <?dbhtml list-presentation="table"?>
184
185 <varlistentry id="ata_id">
186 <term><command>ata_id</command></term>
187 <listitem>
188 <para>Provides Udev with a unique string and
189 additional information (uuid, label) for an ATA drive</para>
190 <indexterm zone="ch-system-udev ata_id">
191 <primary sortas="b-ata_id">ata_id</primary>
192 </indexterm>
193 </listitem>
194 </varlistentry>
195
196 <varlistentry id="cdrom_id">
197 <term><command>cdrom_id</command></term>
198 <listitem>
199 <para>Provides Udev with the capabilities of a
200 CD-ROM or DVD-ROM drive</para>
201 <indexterm zone="ch-system-udev cdrom_id">
202 <primary sortas="b-cdrom_id">cdrom_id</primary>
203 </indexterm>
204 </listitem>
205 </varlistentry>
206
207 <varlistentry id="collect">
208 <term><command>collect</command></term>
209 <listitem>
210 <para>Given an ID for the current uevent and a list of
211 IDs (for all target uevents), registers the current ID
212 and indicates whether all target IDs have been registered</para>
213 <indexterm zone="ch-system-udev collect">
214 <primary sortas="b-collect">collect</primary>
215 </indexterm>
216 </listitem>
217 </varlistentry>
218
219 <varlistentry id="create_floppy_devices">
220 <term><command>create_floppy_devices</command></term>
221 <listitem>
222 <para>Creates all possible floppy devices based on the CMOS type</para>
223 <indexterm zone="ch-system-udev create_floppy_devices">
224 <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
225 </indexterm>
226 </listitem>
227 </varlistentry>
228
229 <varlistentry id="edd_id">
230 <term><command>edd_id</command></term>
231 <listitem>
232 <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
233 <indexterm zone="ch-system-udev edd_id">
234 <primary sortas="b-edd_id">edd_id</primary>
235 </indexterm>
236 </listitem>
237 </varlistentry>
238
239 <varlistentry id="firmware.sh">
240 <term><command>firmware.sh</command></term>
241 <listitem>
242 <para>Uploads firmware to devices</para>
243 <indexterm zone="ch-system-udev firmware.sh">
244 <primary sortas="b-firmware.sh">firmware.sh</primary>
245 </indexterm>
246 </listitem>
247 </varlistentry>
248
249 <varlistentry id="fstab_import">
250 <term><command>fstab_import</command></term>
251 <listitem>
252 <para>Finds an entry in <filename>/etc/fstab</filename> that
253 matches the current device, and provides its information to
254 Udev</para>
255 <indexterm zone="ch-system-udev fstab_import">
256 <primary sortas="b-fstab_import">fstab_import</primary>
257 </indexterm>
258 </listitem>
259 </varlistentry>
260
261 <varlistentry id="path_id">
262 <term><command>path_id</command></term>
263 <listitem>
264 <para>Provides the shortest possible unique hardware path to a
265 device</para>
266 <indexterm zone="ch-system-udev path_id">
267 <primary sortas="b-path_id">path_id</primary>
268 </indexterm>
269 </listitem>
270 </varlistentry>
271
272 <varlistentry id="scsi_id">
273 <term><command>scsi_id</command></term>
274 <listitem>
275 <para>Provides Udev with a unique SCSI identifier
276 based on the data returned from sending a SCSI INQUIRY command to
277 the specified device</para>
278 <indexterm zone="ch-system-udev scsi_id">
279 <primary sortas="b-scsi_id">scsi_id</primary>
280 </indexterm>
281 </listitem>
282 </varlistentry>
283
284 <varlistentry id="udevadm">
285 <term><command>udevadm</command></term>
286 <listitem>
287 <para>Generic udev administration tool: controls the udevd daemon,
288 provides info from the Udev database, monitors uevents, waits for
289 uevents to finish, tests Udev configuration, and triggers uevents
290 for a given device</para>
291 <indexterm zone="ch-system-udev udevadm">
292 <primary sortas="b-udevadm">udevadm</primary>
293 </indexterm>
294 </listitem>
295 </varlistentry>
296
297 <varlistentry id="udevd">
298 <term><command>udevd</command></term>
299 <listitem>
300 <para>A daemon that listens for uevents on the netlink socket,
301 creates devices and runs the configured external programs in
302 response to these uevents</para>
303 <indexterm zone="ch-system-udev udevd">
304 <primary sortas="b-udevd">udevd</primary>
305 </indexterm>
306 </listitem>
307 </varlistentry>
308
309 <varlistentry id="usb_id">
310 <term><command>usb_id</command></term>
311 <listitem>
312 <para>Provides Udev with information about USB
313 devices</para>
314 <indexterm zone="ch-system-udev usb_id">
315 <primary sortas="b-usb_id">usb_id</primary>
316 </indexterm>
317 </listitem>
318 </varlistentry>
319
320 <varlistentry id="write_cd_rules">
321 <term><command>write_cd_rules</command></term>
322 <listitem>
323 <para>A script which generates Udev rules to provide stable names for
324 optical drives (see also <xref linkend="ch-scripts-symlinks"/>)</para>
325 <indexterm zone="ch-system-udev write_cd_rules">
326 <primary sortas="b-write_cd_rules">write_cd_rules</primary>
327 </indexterm>
328 </listitem>
329 </varlistentry>
330
331 <varlistentry id="write_net_rules">
332 <term><command>write_net_rules</command></term>
333 <listitem>
334 <para>A script which generates rules to provide stable names for
335 network interfaces (see also <xref linkend="ch-scripts-network"/>)
336 </para>
337 <indexterm zone="ch-system-udev write_net_rules">
338 <primary sortas="b-write_net_rules">write_net_rules</primary>
339 </indexterm>
340 </listitem>
341 </varlistentry>
342
343 <varlistentry id="libudev">
344 <term><command>libudev</command></term>
345 <listitem>
346 <para>A library interface to udev device information</para>
347 <indexterm zone="ch-system-udev libudev">
348 <primary sortas="c-libudev">libudev</primary>
349 </indexterm>
350 </listitem>
351 </varlistentry>
352
353 <varlistentry id="etc-udev">
354 <term><filename class="directory">/etc/udev</filename></term>
355 <listitem>
356 <para>Contains Udev configuration files,
357 device permissions, and rules for device naming</para>
358 <indexterm zone="ch-system-udev etc-udev">
359 <primary sortas="e-/etc/udev">/etc/udev</primary>
360 </indexterm>
361 </listitem>
362 </varlistentry>
363
364 </variablelist>
365
366 </sect2>
367
368</sect1>
Note: See TracBrowser for help on using the repository browser.