source: chapter06/udev.xml@ 61fd325

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.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 61fd325 was 5f7456b, checked in by Matthew Burgess <matthew@…>, 15 years ago

Various text corrections from Chris Staub. Fixes #2470.

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

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