source: chapter06/udev.xml@ c310ddd

Last change on this file since c310ddd was 3d16951, checked in by Matthew Burgess <matthew@…>, 19 years ago

Add descriptions of Udev's helper binaries

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

  • Property mode set to 100644
File size: 9.2 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-udev" role="wrap">
7<title>Udev-&udev-version;</title>
8<?dbhtml filename="udev.html"?>
9
10<indexterm zone="ch-system-udev"><primary sortas="a-Udev">Udev</primary></indexterm>
11
12<sect2 role="package"><title/>
13<para>The Udev package contains programs for dynamic creation of device nodes.</para>
14
15<segmentedlist>
16<segtitle>&buildtime;</segtitle>
17<segtitle>&diskspace;</segtitle>
18<seglistitem><seg>0.1 SBU</seg><seg>3.1 MB</seg></seglistitem>
19</segmentedlist>
20
21<segmentedlist>
22<segtitle>&dependencies;</segtitle>
23<seglistitem><seg>Coreutils and Make</seg></seglistitem>
24</segmentedlist>
25
26</sect2>
27
28<sect2 role="installation">
29<title>Installation of Udev</title>
30
31<para>Create some devices that Udev cannot handle due to them being required
32very early in the boot process:</para>
33
34<screen><userinput>ln -sv /proc/self/fd /lib/udev/devices/fd
35ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
36ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
37ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
38ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
39
40<para>Compile the package:</para>
41
42<screen><userinput>make \
43EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id extras/firmware extras/floppy extras/scsi_id extras/usb_id extras/volume_id"</userinput></screen>
44
45<para>The meaning of the make option:</para>
46
47<variablelist>
48 <varlistentry>
49 <term><parameter>EXTRAS=...</parameter></term>
50 <listitem>
51 <para>This builds several helper binaries that can aid in writing custom
52 Udev rules.</para>
53 </listitem>
54 </varlistentry>
55</variablelist>
56
57<para>To test the results, issue:
58<userinput>make test</userinput>.</para>
59
60<para>Install the package:</para>
61
62<screen><userinput>make DESTDIR=/ \
63EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id extras/firmware extras/floppy extras/scsi_id extras/usb_id extras/volume_id" \
64install</userinput></screen>
65
66<para>The meaning of the make option:</para>
67
68<variablelist>
69 <varlistentry>
70 <term><parameter>DESTDIR=/</parameter>
71 </term>
72 <listitem>
73 <para>This prevents the Udev build process from killing any
74 <command>udevd</command> processes that may be running on the host
75 system.
76 </para>
77 </listitem>
78 </varlistentry>
79</variablelist>
80
81<para>Udev's configuration is far from ideal by default, so install
82the configuration files here:</para>
83
84<screen><userinput>cp -v ../&udev-config-file; /etc/udev/rules.d/25-lfs.rules</userinput></screen>
85
86<para>Alter Udev's configuration file so that Udev can automatically load kernel
87modules.</para>
88
89<screen><userinput>sed -i 147,150d /etc/udev/rules.d/25-lfs.rules
90cat &gt;&gt; /etc/udev/rules.d/25-lfs.rules &lt;&lt; EOF
91# Rules to allow hotplugging of devices with modular drivers
92ACTION=="add", SUBSYSTEM=="usb", MODALIAS=="*", \
93 RUN+="/sbin/modprobe $modalias"
94ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[07]", \
95 RUN+="/sbin/modprobe sd_mod"
96EOF</userinput></screen>
97
98<para>Install the documentation that explains how to create Udev rules:</para>
99
100<screen><userinput>install -m644 -D -v docs/writing_udev_rules/index.html /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
101
102<!-- Not for the LiveCD -->
103<!-- Edit Me -->
104
105<para>Run the <command>udevstart</command> program to create our full
106complement of device nodes.</para>
107
108<screen><userinput>/sbin/udevstart</userinput></screen>
109
110</sect2>
111
112<sect2 id="contents-udev" role="content"><title>Contents of Udev</title>
113
114<segmentedlist>
115<segtitle>Installed programs</segtitle>
116<segtitle>Installed directory</segtitle>
117<seglistitem><seg>ata_id, cdrom_id, create_floppy_devices, edd_id,
118firmware_helper, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevtest,
119usb_id and vol_id</seg>
120<seg>/etc/udev</seg></seglistitem>
121</segmentedlist>
122
123<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
124<?dbfo list-presentation="list"?>
125<?dbhtml list-presentation="table"?>
126
127<varlistentry id="ata_id">
128 <term>
129 <command>ata_id</command>
130 </term>
131 <listitem>
132 <para>Provides <command>udev</command> with a unique string and additional
133 information (uuid, label) for an ATA drive</para>
134 <indexterm zone="ch-system-udev ata_id">
135 <primary sortas="b-ata_id">ata_id</primary>
136 </indexterm>
137 </listitem>
138</varlistentry>
139
140<varlistentry id="cdrom_id">
141 <term>
142 <command>cdrom_id</command>
143 </term>
144 <listitem>
145 <para>Provides <command>udev</command> with the capabilities of a CD-ROM or
146 DVD-ROM drive</para>
147 <indexterm zone="ch-system-udev cdrom_id">
148 <primary sortas="b-cdrom_id">cdrom_id</primary>
149 </indexterm>
150 </listitem>
151</varlistentry>
152
153<varlistentry id="create_floppy_devices">
154 <term>
155 <command>create_floppy_devices</command>
156 </term>
157 <listitem>
158 <para>Creates all possible floppy devices based on the CMOS type</para>
159 <indexterm zone="ch-system-udev create_floppy_devices">
160 <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
161 </indexterm>
162 </listitem>
163</varlistentry>
164
165<varlistentry id="edd_id">
166 <term>
167 <command>edd_id</command>
168 </term>
169 <listitem>
170 <para>Provides <command>udev</command> with the EDD ID for a BIOS disk
171 drive</para>
172 <indexterm zone="ch-system-udev edd_id">
173 <primary sortas="b-edd_id">edd_id</primary>
174 </indexterm>
175 </listitem>
176</varlistentry>
177
178<varlistentry id="firmware_helper">
179 <term>
180 <command>firmware_helper</command>
181 </term>
182 <listitem>
183 <para>Enables <command>udev</command> to upload 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="scsi_id">
191 <term>
192 <command>scsi_id</command>
193 </term>
194 <listitem>
195 <para>Provides <command>udev</command> with a unique SCSI identifier based
196 on the data returned from sending a SCSI INQUIRY command to the specified
197 device</para>
198 <indexterm zone="ch-system-udev scsi_id">
199 <primary sortas="b-scsi_id">scsi_id</primary>
200 </indexterm>
201 </listitem>
202</varlistentry>
203
204<varlistentry id="udevcontrol">
205<term><command>udevcontrol</command></term>
206<listitem>
207<para>Configures a number of options for the running <command>udevd</command>
208daemon, such as the log level.</para>
209<indexterm zone="ch-system-udev udevcontrol"><primary sortas="b-udevcontrol">udevcontrol</primary>
210</indexterm>
211</listitem></varlistentry>
212
213<varlistentry id="udevd">
214<term><command>udevd</command></term>
215<listitem>
216<para>A daemon that reorders hotplug events before submitting them to
217<command>udev</command>,
218thus avoiding various race conditions</para>
219<indexterm zone="ch-system-udev udevd"><primary sortas="b-udevd">udevd</primary></indexterm>
220</listitem></varlistentry>
221
222<varlistentry id="udevinfo">
223<term><command>udevinfo</command></term>
224<listitem>
225<para>Allows users to query the <command>udev</command> database for
226information on any device currently present on the system; it also
227provides a way to query any device in the <systemitem
228class="filesystem">sysfs</systemitem> tree to help create udev
229rules</para>
230<indexterm zone="ch-system-udev udevinfo"><primary sortas="b-udevinfo">udevinfo</primary></indexterm>
231</listitem></varlistentry>
232
233<varlistentry id="udevmonitor">
234<term><command>udevmonitor</command></term>
235<listitem>
236<para>Prints the event received from the kernel and the event which
237<command>udev</command> sends out after rule processing</para>
238<indexterm zone="ch-system-udev udevmonitor"><primary sortas="b-udevmonitor">udevmonitor</primary>
239</indexterm>
240</listitem></varlistentry>
241
242<varlistentry id="udevtest">
243<term><command>udevtest</command></term>
244<listitem>
245<para>Simulates a <command>udev</command> run for the given device,
246and prints out the name of the node the real <command>udev</command> would
247have created or (not in LFS) the name of the renamed network interface</para>
248<indexterm zone="ch-system-udev udevtest"><primary sortas="b-udevtest">udevtest</primary></indexterm>
249</listitem></varlistentry>
250
251<varlistentry id="usb_id">
252 <term>
253 <command>usb_id</command>
254 </term>
255 <listitem>
256 <para>Provides <command>udev</command> with information about USB devices
257 </para>
258 <indexterm zone="ch-system-udev usb_id">
259 <primary sortas="b-usb_id">usb_id</primary>
260 </indexterm>
261 </listitem>
262</varlistentry>
263
264<varlistentry id="vol_id">
265 <term>
266 <command>vol_id</command>
267 </term>
268 <listitem>
269 <para>Provides <command>udev</command> with the label and uuid of a
270 filesystem</para>
271 <indexterm zone="ch-system-udev vol_id">
272 <primary sortas="b-vol_id">vol_id</primary>
273 </indexterm>
274 </listitem>
275</varlistentry>
276
277<varlistentry id="etc-udev">
278<term><filename class="directory">/etc/udev</filename></term>
279<listitem>
280<para>Contains <command>udev</command> configuation files,
281device permissions, and rules for device naming</para>
282<indexterm zone="ch-system-udev etc-udev"><primary sortas="e-/etc/udev">/etc/udev</primary></indexterm>
283</listitem></varlistentry>
284</variablelist>
285</sect2>
286
287</sect1>
288
Note: See TracBrowser for help on using the repository browser.