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}}
|
---|
53 | mknod -m0666 /lib/udev/devices/null c 1 3
|
---|
54 | mknod -m0600 /lib/udev/devices/kmsg c 1 11
|
---|
55 | ln -sv /proc/self/fd /lib/udev/devices/fd
|
---|
56 | ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
|
---|
57 | ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
|
---|
58 | ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
|
---|
59 | ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
|
---|
60 |
|
---|
61 | <para>Compile the package:</para>
|
---|
62 |
|
---|
63 | <screen><userinput remap="make">make EXTRAS="`echo extras/*/`"</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 the 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:</para>
|
---|
79 |
|
---|
80 | <screen><userinput remap="test">make test</userinput></screen>
|
---|
81 |
|
---|
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 |
|
---|
85 | <para>Install the package:</para>
|
---|
86 |
|
---|
87 | <screen><userinput remap="install">make DESTDIR=/ EXTRAS="`echo extras/*/`" install</userinput></screen>
|
---|
88 |
|
---|
89 | <variablelist>
|
---|
90 | <title>The meaning of the make parameter:</title>
|
---|
91 |
|
---|
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>
|
---|
100 |
|
---|
101 | </variablelist>
|
---|
102 |
|
---|
103 | <para>Udev has to be configured in order to work properly, as its default
|
---|
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>
|
---|
121 |
|
---|
122 | <screen><userinput remap="install">cd &udev-config;
|
---|
123 | make install</userinput></screen>
|
---|
124 |
|
---|
125 | <para>Install the documentation that explains the LFS-specific rules
|
---|
126 | files:</para>
|
---|
127 |
|
---|
128 | <screen><userinput remap="install">make install-doc</userinput></screen>
|
---|
129 |
|
---|
130 | <para>Install the documentation that explains the commonly-used rules
|
---|
131 | files provided by Udev:</para>
|
---|
132 |
|
---|
133 | <screen><userinput remap="install">make install-extra-doc</userinput></screen>
|
---|
134 |
|
---|
135 | <para>Install the documentation that explains how to create custom Udev
|
---|
136 | rules:</para>
|
---|
137 |
|
---|
138 | <screen><userinput remap="install">cd ..
|
---|
139 | install -dv /usr/share/doc/udev-&udev-version;
|
---|
140 | install -m644 -v docs/writing_udev_rules/index.html \
|
---|
141 | /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
|
---|
142 |
|
---|
143 | </sect2>
|
---|
144 |
|
---|
145 | <sect2 id="contents-udev" role="content">
|
---|
146 | <title>Contents of Udev</title>
|
---|
147 |
|
---|
148 | <segmentedlist>
|
---|
149 | <segtitle>Installed programs</segtitle>
|
---|
150 | <segtitle>Installed libraries</segtitle>
|
---|
151 | <segtitle>Installed directory</segtitle>
|
---|
152 |
|
---|
153 | <seglistitem>
|
---|
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>
|
---|
157 | <seg>libvolume_id</seg>
|
---|
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 |
|
---|
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 |
|
---|
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 |
|
---|
201 | <varlistentry id="create_floppy_devices">
|
---|
202 | <term><command>create_floppy_devices</command></term>
|
---|
203 | <listitem>
|
---|
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>
|
---|
207 | </indexterm>
|
---|
208 | </listitem>
|
---|
209 | </varlistentry>
|
---|
210 |
|
---|
211 | <varlistentry id="edd_id">
|
---|
212 | <term><command>edd_id</command></term>
|
---|
213 | <listitem>
|
---|
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>
|
---|
217 | </indexterm>
|
---|
218 | </listitem>
|
---|
219 | </varlistentry>
|
---|
220 |
|
---|
221 | <varlistentry id="firmware.sh">
|
---|
222 | <term><command>firmware.sh</command></term>
|
---|
223 | <listitem>
|
---|
224 | <para>Uploads firmware to devices</para>
|
---|
225 | <indexterm zone="ch-system-udev firmware.sh">
|
---|
226 | <primary sortas="b-firmware.sh">firmware.sh</primary>
|
---|
227 | </indexterm>
|
---|
228 | </listitem>
|
---|
229 | </varlistentry>
|
---|
230 |
|
---|
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 |
|
---|
243 | <varlistentry id="path_id">
|
---|
244 | <term><command>path_id</command></term>
|
---|
245 | <listitem>
|
---|
246 | <para>Provides the shortest possible unique hardware path to a
|
---|
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 |
|
---|
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>
|
---|
262 | </indexterm>
|
---|
263 | </listitem>
|
---|
264 | </varlistentry>
|
---|
265 |
|
---|
266 | <varlistentry id="udevadm">
|
---|
267 | <term><command>udevadm</command></term>
|
---|
268 | <listitem>
|
---|
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>
|
---|
275 | </indexterm>
|
---|
276 | </listitem>
|
---|
277 | </varlistentry>
|
---|
278 |
|
---|
279 | <varlistentry id="udevd">
|
---|
280 | <term><command>udevd</command></term>
|
---|
281 | <listitem>
|
---|
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>
|
---|
285 | <indexterm zone="ch-system-udev udevd">
|
---|
286 | <primary sortas="b-udevd">udevd</primary>
|
---|
287 | </indexterm>
|
---|
288 | </listitem>
|
---|
289 | </varlistentry>
|
---|
290 |
|
---|
291 | <varlistentry id="usb_id">
|
---|
292 | <term><command>usb_id</command></term>
|
---|
293 | <listitem>
|
---|
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>
|
---|
298 | </indexterm>
|
---|
299 | </listitem>
|
---|
300 | </varlistentry>
|
---|
301 |
|
---|
302 | <varlistentry id="vol_id">
|
---|
303 | <term><command>vol_id</command></term>
|
---|
304 | <listitem>
|
---|
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>
|
---|
309 | </indexterm>
|
---|
310 | </listitem>
|
---|
311 | </varlistentry>
|
---|
312 |
|
---|
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 |
|
---|
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>
|
---|