source: chapter06/udev.xml@ c49647b1

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 c49647b1 was 68edbd40, checked in by DJ Lucas <dj@…>, 16 years ago

Corrected installation of udev rules files in chapter 6.

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

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