source: chapter06/udev.xml@ b5d1166

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.3 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 b5d1166 was fe8dbe1, checked in by Bryan Kadzban <bryan@…>, 18 years ago

Update udev-config, and add Udev SAS path_id patch (both for Linux-2.6.18).

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

  • Property mode set to 100644
File size: 11.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/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 <title>Udev-&udev-version;</title>
12
13 <indexterm zone="ch-system-udev">
14 <primary sortas="a-Udev">Udev</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The Udev package contains programs for dynamic creation of device
21 nodes.</para>
22
23 <segmentedlist>
24 <segtitle>&buildtime;</segtitle>
25 <segtitle>&diskspace;</segtitle>
26
27 <seglistitem>
28 <seg>&udev-ch6-sbu;</seg>
29 <seg>&udev-ch6-du;</seg>
30 </seglistitem>
31 </segmentedlist>
32
33 </sect2>
34
35 <sect2 role="installation">
36 <title>Installation of Udev</title>
37
38 <para>The udev-config tarball contains LFS-specific files used to configure
39 Udev. Unpack it into the Udev source directory:</para>
40
41<screen><userinput>tar xf ../&udev-config;.tar.bz2</userinput></screen>
42
43 <para>Create some devices and directories that Udev cannot handle due to
44 them being required very early in the boot process:</para>
45
46<screen><userinput>install -dv /lib/{firmware,udev/devices/{pts,shm}}
47mknod -m0666 /lib/udev/devices/null c 1 3
48ln -sv /proc/self/fd /lib/udev/devices/fd
49ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
50ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
51ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
52ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
53
54 <para>Linux-2.6.18 and newer have changed the sysfs layout for SAS devices.
55 The following patch fixes Udev's path_id script to handle the new layout:</para>
56
57<screen><userinput>patch -Np1 -i ../&udev-sas-patch;</userinput></screen>
58
59 <para>Compile the package:</para>
60
61<screen><userinput>make EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
62 extras/firmware extras/floppy extras/path_id extras/rule_generator \
63 extras/scsi_id extras/usb_id extras/volume_id"</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 several 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:
79 <userinput>make test</userinput>.</para>
80
81 <para>Note that the Udev testsuite will produce numerous messages in
82 the host system's logs. These are harmless and can be ignored.</para>
83
84 <para>Install the package:</para>
85
86<screen><userinput>make DESTDIR=/ \
87 EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
88 extras/firmware extras/floppy extras/path_id extras/rule_generator \
89 extras/scsi_id extras/usb_id extras/volume_id" install</userinput></screen>
90
91 <variablelist>
92 <title>The meaning of the make parameter:</title>
93
94 <varlistentry>
95 <term><parameter>DESTDIR=/</parameter></term>
96 <listitem>
97 <para>This prevents the Udev build process from killing any
98 <command>udevd</command> processes that may be running on the
99 host system.</para>
100 </listitem>
101 </varlistentry>
102
103 </variablelist>
104
105 <para>Udev has to be configured in order to work properly, as it does
106 not install any configuration files by default. Install the
107 LFS-specific configuration files:</para>
108
109<screen><userinput>cp -v &udev-config;/[0-9]* /etc/udev/rules.d/</userinput></screen>
110
111 <para>Install the documentation that explains how to create Udev rules:</para>
112
113<screen><userinput>install -m644 -D -v docs/writing_udev_rules/index.html \
114 /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
115
116 </sect2>
117
118 <sect2 id="contents-udev" role="content">
119 <title>Contents of Udev</title>
120
121 <segmentedlist>
122 <segtitle>Installed programs</segtitle>
123 <segtitle>Installed directory</segtitle>
124
125 <seglistitem>
126 <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware_helper,
127 path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle,
128 udevtest, udevtrigger, usb_id, vol_id, and write_cd_aliases</seg>
129 <seg>/etc/udev</seg>
130 </seglistitem>
131 </segmentedlist>
132
133 <variablelist>
134 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
135 <?dbfo list-presentation="list"?>
136 <?dbhtml list-presentation="table"?>
137
138 <varlistentry id="ata_id">
139 <term><command>ata_id</command></term>
140 <listitem>
141 <para>Provides Udev with a unique string and
142 additional information (uuid, label) for an ATA drive</para>
143 <indexterm zone="ch-system-udev ata_id">
144 <primary sortas="b-ata_id">ata_id</primary>
145 </indexterm>
146 </listitem>
147 </varlistentry>
148
149 <varlistentry id="cdrom_id">
150 <term><command>cdrom_id</command></term>
151 <listitem>
152 <para>Provides Udev with the capabilities of a
153 CD-ROM or DVD-ROM drive</para>
154 <indexterm zone="ch-system-udev cdrom_id">
155 <primary sortas="b-cdrom_id">cdrom_id</primary>
156 </indexterm>
157 </listitem>
158 </varlistentry>
159
160 <varlistentry id="create_floppy_devices">
161 <term><command>create_floppy_devices</command></term>
162 <listitem>
163 <para>Creates all possible floppy devices based on the CMOS type</para>
164 <indexterm zone="ch-system-udev create_floppy_devices">
165 <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
166 </indexterm>
167 </listitem>
168 </varlistentry>
169
170 <varlistentry id="edd_id">
171 <term><command>edd_id</command></term>
172 <listitem>
173 <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
174 <indexterm zone="ch-system-udev edd_id">
175 <primary sortas="b-edd_id">edd_id</primary>
176 </indexterm>
177 </listitem>
178 </varlistentry>
179
180 <varlistentry id="firmware_helper">
181 <term><command>firmware_helper</command></term>
182 <listitem>
183 <para>Uploads firmware to devices</para>
184 <indexterm zone="ch-system-udev firmware_helper">
185 <primary sortas="b-firmware_helper">firmware_helper</primary>
186 </indexterm>
187 </listitem>
188 </varlistentry>
189
190 <varlistentry id="path_id">
191 <term><command>path_id</command></term>
192 <listitem>
193 <para>Provide the shortest possible unique hardware path to a
194 device</para>
195 <indexterm zone="ch-system-udev path_id">
196 <primary sortas="b-path_id">path_id</primary>
197 </indexterm>
198 </listitem>
199 </varlistentry>
200
201 <varlistentry id="scsi_id">
202 <term><command>scsi_id</command></term>
203 <listitem>
204 <para>Provides Udev with a unique SCSI identifier
205 based on the data returned from sending a SCSI INQUIRY command to
206 the specified device</para>
207 <indexterm zone="ch-system-udev scsi_id">
208 <primary sortas="b-scsi_id">scsi_id</primary>
209 </indexterm>
210 </listitem>
211 </varlistentry>
212
213 <varlistentry id="udevcontrol">
214 <term><command>udevcontrol</command></term>
215 <listitem>
216 <para>Configures a number of options for the running
217 <command>udevd</command> daemon, such as the log level.</para>
218 <indexterm zone="ch-system-udev udevcontrol">
219 <primary sortas="b-udevcontrol">udevcontrol</primary>
220 </indexterm>
221 </listitem>
222 </varlistentry>
223
224 <varlistentry id="udevd">
225 <term><command>udevd</command></term>
226 <listitem>
227 <para>A daemon that listens for uevents on the netlink socket,
228 creates devices and runs the configured external programs in
229 response to these uevents</para>
230 <indexterm zone="ch-system-udev udevd">
231 <primary sortas="b-udevd">udevd</primary>
232 </indexterm>
233 </listitem>
234 </varlistentry>
235
236 <varlistentry id="udevinfo">
237 <term><command>udevinfo</command></term>
238 <listitem>
239 <para>Allows users to query the Udev database for
240 information on any device currently present on the system; it also
241 provides a way to query any device in the <systemitem
242 class="filesystem">sysfs</systemitem> tree to help create udev
243 rules</para>
244 <indexterm zone="ch-system-udev udevinfo">
245 <primary sortas="b-udevinfo">udevinfo</primary>
246 </indexterm>
247 </listitem>
248 </varlistentry>
249
250 <varlistentry id="udevmonitor">
251 <term><command>udevmonitor</command></term>
252 <listitem>
253 <para>Prints the event received from the kernel and the environment
254 which Udev sends out after rule processing</para>
255 <indexterm zone="ch-system-udev udevmonitor">
256 <primary sortas="b-udevmonitor">udevmonitor</primary>
257 </indexterm>
258 </listitem>
259 </varlistentry>
260
261 <varlistentry id="udevsettle">
262 <term><command>udevsettle</command></term>
263 <listitem>
264 <para>Watches the Udev event queue and exits if all current uevents
265 have been handled</para>
266 <indexterm zone="ch-system-udev udevsettle">
267 <primary sortas="b-udevsettle">udevsettle</primary>
268 </indexterm>
269 </listitem>
270 </varlistentry>
271
272 <varlistentry id="udevtest">
273 <term><command>udevtest</command></term>
274 <listitem>
275 <para>Simulates a uevent for the given device, and prints out the
276 name of the node the real <command>udevd</command> would have created,
277 or the name of the renamed network interface</para>
278 <indexterm zone="ch-system-udev udevtest">
279 <primary sortas="b-udevtest">udevtest</primary>
280 </indexterm>
281 </listitem>
282 </varlistentry>
283
284 <varlistentry id="udevtrigger">
285 <term><command>udevtrigger</command></term>
286 <listitem>
287 <para>Triggers kernel device uevents to be replayed</para>
288 <indexterm zone="ch-system-udev udevtrigger">
289 <primary sortas="b-udevtrigger">udevtrigger</primary>
290 </indexterm>
291 </listitem>
292 </varlistentry>
293
294 <varlistentry id="usb_id">
295 <term><command>usb_id</command></term>
296 <listitem>
297 <para>Provides Udev with information about USB
298 devices</para>
299 <indexterm zone="ch-system-udev usb_id">
300 <primary sortas="b-usb_id">usb_id</primary>
301 </indexterm>
302 </listitem>
303 </varlistentry>
304
305 <varlistentry id="vol_id">
306 <term><command>vol_id</command></term>
307 <listitem>
308 <para>Provides Udev with the label and uuid of a
309 filesystem</para>
310 <indexterm zone="ch-system-udev vol_id">
311 <primary sortas="b-vol_id">vol_id</primary>
312 </indexterm>
313 </listitem>
314 </varlistentry>
315
316 <varlistentry id="etc-udev">
317 <term><filename class="directory">/etc/udev</filename></term>
318 <listitem>
319 <para>Contains Udev configuation files,
320 device permissions, and rules for device naming</para>
321 <indexterm zone="ch-system-udev etc-udev">
322 <primary sortas="e-/etc/udev">/etc/udev</primary>
323 </indexterm>
324 </listitem>
325 </varlistentry>
326
327 </variablelist>
328
329 </sect2>
330
331</sect1>
Note: See TracBrowser for help on using the repository browser.