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>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:</para>
|
---|
51 |
|
---|
52 | <screen><userinput>install -dv /lib/{firmware,udev/devices/{pts,shm}}
|
---|
53 | mknod -m0666 /lib/udev/devices/null c 1 3
|
---|
54 | ln -sv /proc/self/fd /lib/udev/devices/fd
|
---|
55 | ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
|
---|
56 | ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
|
---|
57 | ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
|
---|
58 | ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
|
---|
59 |
|
---|
60 | <para>Compile the package:</para>
|
---|
61 |
|
---|
62 | <screen><userinput>make EXTRAS="`echo extras/*/`"</userinput></screen>
|
---|
63 |
|
---|
64 | <variablelist>
|
---|
65 | <title>The meaning of the make option:</title>
|
---|
66 |
|
---|
67 | <varlistentry>
|
---|
68 | <term><parameter>EXTRAS=...</parameter></term>
|
---|
69 | <listitem>
|
---|
70 | <para>This builds the helper binaries that can aid in writing custom
|
---|
71 | Udev rules.</para>
|
---|
72 | </listitem>
|
---|
73 | </varlistentry>
|
---|
74 |
|
---|
75 | </variablelist>
|
---|
76 |
|
---|
77 | <para>To test the results, issue:
|
---|
78 | <userinput>make test</userinput>.</para>
|
---|
79 |
|
---|
80 | <para>Note that the Udev testsuite will produce numerous messages in
|
---|
81 | the host system's logs. These are harmless and can be ignored.</para>
|
---|
82 |
|
---|
83 | <para>Install the package:</para>
|
---|
84 |
|
---|
85 | <screen><userinput>make DESTDIR=/ EXTRAS="`echo extras/*/`" install</userinput></screen>
|
---|
86 |
|
---|
87 | <variablelist>
|
---|
88 | <title>The meaning of the make parameter:</title>
|
---|
89 |
|
---|
90 | <varlistentry>
|
---|
91 | <term><parameter>DESTDIR=/</parameter></term>
|
---|
92 | <listitem>
|
---|
93 | <para>This prevents the Udev build process from killing any
|
---|
94 | <command>udevd</command> processes that may be running on the
|
---|
95 | host system.</para>
|
---|
96 | </listitem>
|
---|
97 | </varlistentry>
|
---|
98 |
|
---|
99 | </variablelist>
|
---|
100 |
|
---|
101 | <para>Udev has to be configured in order to work properly, as it only
|
---|
102 | installs a few configuration files by default. First install the
|
---|
103 | commonly-used rules files provided by Udev:</para>
|
---|
104 |
|
---|
105 | <screen><userinput>cp -v etc/udev/rules.d/[0-9]* /etc/udev/rules.d/</userinput></screen>
|
---|
106 |
|
---|
107 | <para>Now install the LFS-specific rules files:</para>
|
---|
108 |
|
---|
109 | <screen><userinput>cd &udev-config;
|
---|
110 | make install</userinput></screen>
|
---|
111 |
|
---|
112 | <para>Install the documentation that explains the LFS-specific rules
|
---|
113 | files:</para>
|
---|
114 |
|
---|
115 | <screen><userinput>make install-doc</userinput></screen>
|
---|
116 |
|
---|
117 | <para>Install the documentation that explains the commonly-used rules
|
---|
118 | files provided by Udev:</para>
|
---|
119 |
|
---|
120 | <screen><userinput>make install-extra-doc</userinput></screen>
|
---|
121 |
|
---|
122 | <para>Install the documentation that explains how to create custom Udev
|
---|
123 | rules:</para>
|
---|
124 |
|
---|
125 | <screen><userinput>cd ..
|
---|
126 | install -m644 -v docs/writing_udev_rules/index.html \
|
---|
127 | /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
|
---|
128 |
|
---|
129 | </sect2>
|
---|
130 |
|
---|
131 | <sect2 id="contents-udev" role="content">
|
---|
132 | <title>Contents of Udev</title>
|
---|
133 |
|
---|
134 | <segmentedlist>
|
---|
135 | <segtitle>Installed programs</segtitle>
|
---|
136 | <segtitle>Installed libraries</segtitle>
|
---|
137 | <segtitle>Installed directory</segtitle>
|
---|
138 |
|
---|
139 | <seglistitem>
|
---|
140 | <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware.sh,
|
---|
141 | path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle,
|
---|
142 | udevtest, udevtrigger, usb_id, vol_id, write_cd_rules, and
|
---|
143 | write_net_rules</seg>
|
---|
144 | <seg>libvolume_id</seg>
|
---|
145 | <seg>/etc/udev</seg>
|
---|
146 | </seglistitem>
|
---|
147 | </segmentedlist>
|
---|
148 |
|
---|
149 | <variablelist>
|
---|
150 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
151 | <?dbfo list-presentation="list"?>
|
---|
152 | <?dbhtml list-presentation="table"?>
|
---|
153 |
|
---|
154 | <varlistentry id="ata_id">
|
---|
155 | <term><command>ata_id</command></term>
|
---|
156 | <listitem>
|
---|
157 | <para>Provides Udev with a unique string and
|
---|
158 | additional information (uuid, label) for an ATA drive</para>
|
---|
159 | <indexterm zone="ch-system-udev ata_id">
|
---|
160 | <primary sortas="b-ata_id">ata_id</primary>
|
---|
161 | </indexterm>
|
---|
162 | </listitem>
|
---|
163 | </varlistentry>
|
---|
164 |
|
---|
165 | <varlistentry id="cdrom_id">
|
---|
166 | <term><command>cdrom_id</command></term>
|
---|
167 | <listitem>
|
---|
168 | <para>Provides Udev with the capabilities of a
|
---|
169 | CD-ROM or DVD-ROM drive</para>
|
---|
170 | <indexterm zone="ch-system-udev cdrom_id">
|
---|
171 | <primary sortas="b-cdrom_id">cdrom_id</primary>
|
---|
172 | </indexterm>
|
---|
173 | </listitem>
|
---|
174 | </varlistentry>
|
---|
175 |
|
---|
176 | <varlistentry id="create_floppy_devices">
|
---|
177 | <term><command>create_floppy_devices</command></term>
|
---|
178 | <listitem>
|
---|
179 | <para>Creates all possible floppy devices based on the CMOS type</para>
|
---|
180 | <indexterm zone="ch-system-udev create_floppy_devices">
|
---|
181 | <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
|
---|
182 | </indexterm>
|
---|
183 | </listitem>
|
---|
184 | </varlistentry>
|
---|
185 |
|
---|
186 | <varlistentry id="edd_id">
|
---|
187 | <term><command>edd_id</command></term>
|
---|
188 | <listitem>
|
---|
189 | <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
|
---|
190 | <indexterm zone="ch-system-udev edd_id">
|
---|
191 | <primary sortas="b-edd_id">edd_id</primary>
|
---|
192 | </indexterm>
|
---|
193 | </listitem>
|
---|
194 | </varlistentry>
|
---|
195 |
|
---|
196 | <varlistentry id="firmware.sh">
|
---|
197 | <term><command>firmware.sh</command></term>
|
---|
198 | <listitem>
|
---|
199 | <para>Uploads firmware to devices</para>
|
---|
200 | <indexterm zone="ch-system-udev firmware.sh">
|
---|
201 | <primary sortas="b-firmware.sh">firmware.sh</primary>
|
---|
202 | </indexterm>
|
---|
203 | </listitem>
|
---|
204 | </varlistentry>
|
---|
205 |
|
---|
206 | <varlistentry id="path_id">
|
---|
207 | <term><command>path_id</command></term>
|
---|
208 | <listitem>
|
---|
209 | <para>Provides the shortest possible unique hardware path to a
|
---|
210 | device</para>
|
---|
211 | <indexterm zone="ch-system-udev path_id">
|
---|
212 | <primary sortas="b-path_id">path_id</primary>
|
---|
213 | </indexterm>
|
---|
214 | </listitem>
|
---|
215 | </varlistentry>
|
---|
216 |
|
---|
217 | <varlistentry id="scsi_id">
|
---|
218 | <term><command>scsi_id</command></term>
|
---|
219 | <listitem>
|
---|
220 | <para>Provides Udev with a unique SCSI identifier
|
---|
221 | based on the data returned from sending a SCSI INQUIRY command to
|
---|
222 | the specified device</para>
|
---|
223 | <indexterm zone="ch-system-udev scsi_id">
|
---|
224 | <primary sortas="b-scsi_id">scsi_id</primary>
|
---|
225 | </indexterm>
|
---|
226 | </listitem>
|
---|
227 | </varlistentry>
|
---|
228 |
|
---|
229 | <varlistentry id="udevcontrol">
|
---|
230 | <term><command>udevcontrol</command></term>
|
---|
231 | <listitem>
|
---|
232 | <para>Configures a number of options for the running
|
---|
233 | <command>udevd</command> daemon, such as the log level.</para>
|
---|
234 | <indexterm zone="ch-system-udev udevcontrol">
|
---|
235 | <primary sortas="b-udevcontrol">udevcontrol</primary>
|
---|
236 | </indexterm>
|
---|
237 | </listitem>
|
---|
238 | </varlistentry>
|
---|
239 |
|
---|
240 | <varlistentry id="udevd">
|
---|
241 | <term><command>udevd</command></term>
|
---|
242 | <listitem>
|
---|
243 | <para>A daemon that listens for uevents on the netlink socket,
|
---|
244 | creates devices and runs the configured external programs in
|
---|
245 | response to these uevents</para>
|
---|
246 | <indexterm zone="ch-system-udev udevd">
|
---|
247 | <primary sortas="b-udevd">udevd</primary>
|
---|
248 | </indexterm>
|
---|
249 | </listitem>
|
---|
250 | </varlistentry>
|
---|
251 |
|
---|
252 | <varlistentry id="udevinfo">
|
---|
253 | <term><command>udevinfo</command></term>
|
---|
254 | <listitem>
|
---|
255 | <para>Allows users to query the Udev database for
|
---|
256 | information on any device currently present on the system; it also
|
---|
257 | provides a way to query any device in the <systemitem
|
---|
258 | class="filesystem">sysfs</systemitem> tree to help create udev
|
---|
259 | rules</para>
|
---|
260 | <indexterm zone="ch-system-udev udevinfo">
|
---|
261 | <primary sortas="b-udevinfo">udevinfo</primary>
|
---|
262 | </indexterm>
|
---|
263 | </listitem>
|
---|
264 | </varlistentry>
|
---|
265 |
|
---|
266 | <varlistentry id="udevmonitor">
|
---|
267 | <term><command>udevmonitor</command></term>
|
---|
268 | <listitem>
|
---|
269 | <para>Prints the event received from the kernel and the environment
|
---|
270 | which Udev sends out after rule processing</para>
|
---|
271 | <indexterm zone="ch-system-udev udevmonitor">
|
---|
272 | <primary sortas="b-udevmonitor">udevmonitor</primary>
|
---|
273 | </indexterm>
|
---|
274 | </listitem>
|
---|
275 | </varlistentry>
|
---|
276 |
|
---|
277 | <varlistentry id="udevsettle">
|
---|
278 | <term><command>udevsettle</command></term>
|
---|
279 | <listitem>
|
---|
280 | <para>Watches the Udev event queue and exits if all current uevents
|
---|
281 | have been handled</para>
|
---|
282 | <indexterm zone="ch-system-udev udevsettle">
|
---|
283 | <primary sortas="b-udevsettle">udevsettle</primary>
|
---|
284 | </indexterm>
|
---|
285 | </listitem>
|
---|
286 | </varlistentry>
|
---|
287 |
|
---|
288 | <varlistentry id="udevtest">
|
---|
289 | <term><command>udevtest</command></term>
|
---|
290 | <listitem>
|
---|
291 | <para>Simulates a uevent for the given device, and prints out the
|
---|
292 | name of the node the real <command>udevd</command> would have created,
|
---|
293 | or the name of the renamed network interface</para>
|
---|
294 | <indexterm zone="ch-system-udev udevtest">
|
---|
295 | <primary sortas="b-udevtest">udevtest</primary>
|
---|
296 | </indexterm>
|
---|
297 | </listitem>
|
---|
298 | </varlistentry>
|
---|
299 |
|
---|
300 | <varlistentry id="udevtrigger">
|
---|
301 | <term><command>udevtrigger</command></term>
|
---|
302 | <listitem>
|
---|
303 | <para>Triggers kernel device uevents to be replayed</para>
|
---|
304 | <indexterm zone="ch-system-udev udevtrigger">
|
---|
305 | <primary sortas="b-udevtrigger">udevtrigger</primary>
|
---|
306 | </indexterm>
|
---|
307 | </listitem>
|
---|
308 | </varlistentry>
|
---|
309 |
|
---|
310 | <varlistentry id="usb_id">
|
---|
311 | <term><command>usb_id</command></term>
|
---|
312 | <listitem>
|
---|
313 | <para>Provides Udev with information about USB
|
---|
314 | devices</para>
|
---|
315 | <indexterm zone="ch-system-udev usb_id">
|
---|
316 | <primary sortas="b-usb_id">usb_id</primary>
|
---|
317 | </indexterm>
|
---|
318 | </listitem>
|
---|
319 | </varlistentry>
|
---|
320 |
|
---|
321 | <varlistentry id="vol_id">
|
---|
322 | <term><command>vol_id</command></term>
|
---|
323 | <listitem>
|
---|
324 | <para>Provides Udev with the label and uuid of a
|
---|
325 | filesystem</para>
|
---|
326 | <indexterm zone="ch-system-udev vol_id">
|
---|
327 | <primary sortas="b-vol_id">vol_id</primary>
|
---|
328 | </indexterm>
|
---|
329 | </listitem>
|
---|
330 | </varlistentry>
|
---|
331 |
|
---|
332 | <varlistentry id="write_cd_rules">
|
---|
333 | <term><command>write_cd_rules</command></term>
|
---|
334 | <listitem>
|
---|
335 | <para>A script which generates Udev rules to provide stable names for
|
---|
336 | optical drives (see also <xref linkend="ch-scripts-symlinks"/>)</para>
|
---|
337 | <indexterm zone="ch-system-udev write_cd_rules">
|
---|
338 | <primary sortas="b-write_cd_rules">write_cd_rules</primary>
|
---|
339 | </indexterm>
|
---|
340 | </listitem>
|
---|
341 | </varlistentry>
|
---|
342 |
|
---|
343 | <varlistentry id="write_net_rules">
|
---|
344 | <term><command>write_net_rules</command></term>
|
---|
345 | <listitem>
|
---|
346 | <para>A script which generates rules to provide stable names for
|
---|
347 | network interfaces (see also <xref linkend="ch-scripts-network"/>)
|
---|
348 | </para>
|
---|
349 | <indexterm zone="ch-system-udev write_net_rules">
|
---|
350 | <primary sortas="b-write_net_rules">write_net_rules</primary>
|
---|
351 | </indexterm>
|
---|
352 | </listitem>
|
---|
353 | </varlistentry>
|
---|
354 |
|
---|
355 | <varlistentry id="libvolume_id">
|
---|
356 | <term><command>libvolume_id</command></term>
|
---|
357 | <listitem>
|
---|
358 | <para></para>
|
---|
359 | <indexterm zone="ch-system-udev libvolume_id">
|
---|
360 | <primary sortas="c-libvolume_id">libvolume_id</primary>
|
---|
361 | </indexterm>
|
---|
362 | </listitem>
|
---|
363 | </varlistentry>
|
---|
364 |
|
---|
365 | <varlistentry id="etc-udev">
|
---|
366 | <term><filename class="directory">/etc/udev</filename></term>
|
---|
367 | <listitem>
|
---|
368 | <para>Contains Udev configuration files,
|
---|
369 | device permissions, and rules for device naming</para>
|
---|
370 | <indexterm zone="ch-system-udev etc-udev">
|
---|
371 | <primary sortas="e-/etc/udev">/etc/udev</primary>
|
---|
372 | </indexterm>
|
---|
373 | </listitem>
|
---|
374 | </varlistentry>
|
---|
375 |
|
---|
376 | </variablelist>
|
---|
377 |
|
---|
378 | </sect2>
|
---|
379 |
|
---|
380 | </sect1>
|
---|