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>0.1 SBU</seg>
|
---|
29 | <seg>3.1 MB</seg>
|
---|
30 | </seglistitem>
|
---|
31 | </segmentedlist>
|
---|
32 |
|
---|
33 | <segmentedlist>
|
---|
34 | <segtitle>&dependencies;</segtitle>
|
---|
35 |
|
---|
36 | <seglistitem>
|
---|
37 | <seg>Coreutils and Make</seg>
|
---|
38 | </seglistitem>
|
---|
39 | </segmentedlist>
|
---|
40 |
|
---|
41 | </sect2>
|
---|
42 |
|
---|
43 | <sect2 role="installation">
|
---|
44 | <title>Installation of Udev</title>
|
---|
45 |
|
---|
46 | <para>Create some devices and directories that Udev cannot handle due to
|
---|
47 | them being required very early in the boot process:</para>
|
---|
48 |
|
---|
49 | <screen><userinput>install -dv /lib/{firmware,udev/devices/{pts,shm}}
|
---|
50 | ln -sv /proc/self/fd /lib/udev/devices/fd
|
---|
51 | ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
|
---|
52 | ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
|
---|
53 | ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
|
---|
54 | ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
|
---|
55 |
|
---|
56 | <para>Compile the package:</para>
|
---|
57 |
|
---|
58 | <screen><userinput>make \
|
---|
59 | EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id extras/firmware extras/floppy extras/scsi_id extras/usb_id extras/volume_id"</userinput></screen>
|
---|
60 |
|
---|
61 | <variablelist>
|
---|
62 | <title>The meaning of the make option:</title>
|
---|
63 |
|
---|
64 | <varlistentry>
|
---|
65 | <term><parameter>EXTRAS=...</parameter></term>
|
---|
66 | <listitem>
|
---|
67 | <para>This builds several helper binaries that can aid in writing custom
|
---|
68 | Udev rules.</para>
|
---|
69 | </listitem>
|
---|
70 | </varlistentry>
|
---|
71 |
|
---|
72 | </variablelist>
|
---|
73 |
|
---|
74 | <para>To test the results, issue:
|
---|
75 | <userinput>make test</userinput>.</para>
|
---|
76 |
|
---|
77 | <para>Install the package:</para>
|
---|
78 |
|
---|
79 | <screen><userinput>make DESTDIR=/ \
|
---|
80 | EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id extras/firmware extras/floppy extras/scsi_id extras/usb_id extras/volume_id" \
|
---|
81 | install</userinput></screen>
|
---|
82 |
|
---|
83 | <variablelist>
|
---|
84 | <title>The meaning of the make parameter:</title>
|
---|
85 |
|
---|
86 | <varlistentry>
|
---|
87 | <term><parameter>DESTDIR=/</parameter></term>
|
---|
88 | <listitem>
|
---|
89 | <para>This prevents the Udev build process from killing any
|
---|
90 | <command>udevd</command> processes that may be running on the
|
---|
91 | host system.</para>
|
---|
92 | </listitem>
|
---|
93 | </varlistentry>
|
---|
94 |
|
---|
95 | </variablelist>
|
---|
96 |
|
---|
97 | <para>Udev's configuration is far from ideal by default, so install
|
---|
98 | the configuration files here:</para>
|
---|
99 |
|
---|
100 | <screen><userinput>cp -v ../&udev-config-file; /etc/udev/rules.d/25-lfs.rules</userinput></screen>
|
---|
101 |
|
---|
102 | <para>Alter Udev's configuration file so that Udev can automatically
|
---|
103 | load kernel modules.</para>
|
---|
104 |
|
---|
105 | <screen><userinput>sed -i 147,150d /etc/udev/rules.d/25-lfs.rules
|
---|
106 | cat >> /etc/udev/rules.d/25-lfs.rules << "EOF"
|
---|
107 | # Rules to allow hotplugging of devices with modular drivers
|
---|
108 | ACTION=="add", SUBSYSTEM=="?*", ENV{MODALIAS}=="?*", \
|
---|
109 | RUN+="/sbin/modprobe $env{MODALIAS}"
|
---|
110 | ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[07]", \
|
---|
111 | RUN+="/sbin/modprobe sd_mod"
|
---|
112 | EOF</userinput></screen>
|
---|
113 |
|
---|
114 | <para>Install the documentation that explains how to create Udev rules:</para>
|
---|
115 |
|
---|
116 | <screen><userinput>install -m644 -D -v docs/writing_udev_rules/index.html /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
|
---|
117 |
|
---|
118 | <!-- Not for the LiveCD -->
|
---|
119 | <!-- Edit Me -->
|
---|
120 |
|
---|
121 | <para>Run the <command>udevstart</command> program to create our full
|
---|
122 | complement of device nodes.</para>
|
---|
123 |
|
---|
124 | <screen><userinput>/sbin/udevstart</userinput></screen>
|
---|
125 |
|
---|
126 | </sect2>
|
---|
127 |
|
---|
128 | <sect2 id="contents-udev" role="content">
|
---|
129 | <title>Contents of Udev</title>
|
---|
130 |
|
---|
131 | <segmentedlist>
|
---|
132 | <segtitle>Installed programs</segtitle>
|
---|
133 | <segtitle>Installed directory</segtitle>
|
---|
134 |
|
---|
135 | <seglistitem>
|
---|
136 | <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware_helper,
|
---|
137 | scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevtest, usb_id
|
---|
138 | and vol_id</seg>
|
---|
139 | <seg>/etc/udev</seg>
|
---|
140 | </seglistitem>
|
---|
141 | </segmentedlist>
|
---|
142 |
|
---|
143 | <variablelist>
|
---|
144 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
145 | <?dbfo list-presentation="list"?>
|
---|
146 | <?dbhtml list-presentation="table"?>
|
---|
147 |
|
---|
148 | <varlistentry id="ata_id">
|
---|
149 | <term><command>ata_id</command></term>
|
---|
150 | <listitem>
|
---|
151 | <para>Provides <command>udev</command> with a unique string and
|
---|
152 | additional information (uuid, label) for an ATA drive</para>
|
---|
153 | <indexterm zone="ch-system-udev ata_id">
|
---|
154 | <primary sortas="b-ata_id">ata_id</primary>
|
---|
155 | </indexterm>
|
---|
156 | </listitem>
|
---|
157 | </varlistentry>
|
---|
158 |
|
---|
159 | <varlistentry id="cdrom_id">
|
---|
160 | <term><command>cdrom_id</command></term>
|
---|
161 | <listitem>
|
---|
162 | <para>Provides <command>udev</command> with the capabilities of a
|
---|
163 | CD-ROM or DVD-ROM drive</para>
|
---|
164 | <indexterm zone="ch-system-udev cdrom_id">
|
---|
165 | <primary sortas="b-cdrom_id">cdrom_id</primary>
|
---|
166 | </indexterm>
|
---|
167 | </listitem>
|
---|
168 | </varlistentry>
|
---|
169 |
|
---|
170 | <varlistentry id="create_floppy_devices">
|
---|
171 | <term><command>create_floppy_devices</command></term>
|
---|
172 | <listitem>
|
---|
173 | <para>Creates all possible floppy devices based on the CMOS type</para>
|
---|
174 | <indexterm zone="ch-system-udev create_floppy_devices">
|
---|
175 | <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
|
---|
176 | </indexterm>
|
---|
177 | </listitem>
|
---|
178 | </varlistentry>
|
---|
179 |
|
---|
180 | <varlistentry id="edd_id">
|
---|
181 | <term><command>edd_id</command></term>
|
---|
182 | <listitem>
|
---|
183 | <para>Provides <command>udev</command> with the EDD ID for a BIOS disk
|
---|
184 | drive</para>
|
---|
185 | <indexterm zone="ch-system-udev edd_id">
|
---|
186 | <primary sortas="b-edd_id">edd_id</primary>
|
---|
187 | </indexterm>
|
---|
188 | </listitem>
|
---|
189 | </varlistentry>
|
---|
190 |
|
---|
191 | <varlistentry id="firmware_helper">
|
---|
192 | <term><command>firmware_helper</command></term>
|
---|
193 | <listitem>
|
---|
194 | <para>Enables <command>udev</command> to upload firmware to
|
---|
195 | devices</para>
|
---|
196 | <indexterm zone="ch-system-udev firmware_helper">
|
---|
197 | <primary sortas="b-firmware_helper">firmware_helper</primary>
|
---|
198 | </indexterm>
|
---|
199 | </listitem>
|
---|
200 | </varlistentry>
|
---|
201 |
|
---|
202 | <varlistentry id="scsi_id">
|
---|
203 | <term><command>scsi_id</command></term>
|
---|
204 | <listitem>
|
---|
205 | <para>Provides <command>udev</command> with a unique SCSI identifier
|
---|
206 | based on the data returned from sending a SCSI INQUIRY command to
|
---|
207 | the specified device</para>
|
---|
208 | <indexterm zone="ch-system-udev scsi_id">
|
---|
209 | <primary sortas="b-scsi_id">scsi_id</primary>
|
---|
210 | </indexterm>
|
---|
211 | </listitem>
|
---|
212 | </varlistentry>
|
---|
213 |
|
---|
214 | <varlistentry id="udevcontrol">
|
---|
215 | <term><command>udevcontrol</command></term>
|
---|
216 | <listitem>
|
---|
217 | <para>Configures a number of options for the running
|
---|
218 | <command>udevd</command> daemon, such as the log level.</para>
|
---|
219 | <indexterm zone="ch-system-udev udevcontrol">
|
---|
220 | <primary sortas="b-udevcontrol">udevcontrol</primary>
|
---|
221 | </indexterm>
|
---|
222 | </listitem>
|
---|
223 | </varlistentry>
|
---|
224 |
|
---|
225 | <varlistentry id="udevd">
|
---|
226 | <term><command>udevd</command></term>
|
---|
227 | <listitem>
|
---|
228 | <para>A daemon that reorders hotplug events before submitting them to
|
---|
229 | <command>udev</command>, thus avoiding various race conditions</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 <command>udev</command> 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 event which
|
---|
254 | <command>udev</command> 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="udevtest">
|
---|
262 | <term><command>udevtest</command></term>
|
---|
263 | <listitem>
|
---|
264 | <para>Simulates a <command>udev</command> run for the given device,
|
---|
265 | and prints out the name of the node the real <command>udev</command>
|
---|
266 | would have created or (not in LFS) the name of the renamed network
|
---|
267 | interface</para>
|
---|
268 | <indexterm zone="ch-system-udev udevtest">
|
---|
269 | <primary sortas="b-udevtest">udevtest</primary>
|
---|
270 | </indexterm>
|
---|
271 | </listitem>
|
---|
272 | </varlistentry>
|
---|
273 |
|
---|
274 | <varlistentry id="usb_id">
|
---|
275 | <term><command>usb_id</command></term>
|
---|
276 | <listitem>
|
---|
277 | <para>Provides <command>udev</command> with information about USB
|
---|
278 | devices</para>
|
---|
279 | <indexterm zone="ch-system-udev usb_id">
|
---|
280 | <primary sortas="b-usb_id">usb_id</primary>
|
---|
281 | </indexterm>
|
---|
282 | </listitem>
|
---|
283 | </varlistentry>
|
---|
284 |
|
---|
285 | <varlistentry id="vol_id">
|
---|
286 | <term><command>vol_id</command></term>
|
---|
287 | <listitem>
|
---|
288 | <para>Provides <command>udev</command> with the label and uuid of a
|
---|
289 | filesystem</para>
|
---|
290 | <indexterm zone="ch-system-udev vol_id">
|
---|
291 | <primary sortas="b-vol_id">vol_id</primary>
|
---|
292 | </indexterm>
|
---|
293 | </listitem>
|
---|
294 | </varlistentry>
|
---|
295 |
|
---|
296 | <varlistentry id="etc-udev">
|
---|
297 | <term><filename class="directory">/etc/udev</filename></term>
|
---|
298 | <listitem>
|
---|
299 | <para>Contains <command>udev</command> configuation files,
|
---|
300 | device permissions, and rules for device naming</para>
|
---|
301 | <indexterm zone="ch-system-udev etc-udev">
|
---|
302 | <primary sortas="e-/etc/udev">/etc/udev</primary>
|
---|
303 | </indexterm>
|
---|
304 | </listitem>
|
---|
305 | </varlistentry>
|
---|
306 |
|
---|
307 | </variablelist>
|
---|
308 |
|
---|
309 | </sect2>
|
---|
310 |
|
---|
311 | </sect1>
|
---|