source: chapter06/udev.xml@ 8465615

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 8465615 was 9faa3e2, checked in by Bryan Kadzban <bryan@…>, 16 years ago

Install a few rules from udev's etc/udev/packages/ directory to handle device-mapper (LVM and dm-raid), md-raid, and a few Palm device symlinks.

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

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