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.8 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
|
---|
32 | very early in the boot process:</para>
|
---|
33 |
|
---|
34 | <screen><userinput>ln -sv /proc/self/fd /lib/udev/devices/fd
|
---|
35 | ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
|
---|
36 | ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
|
---|
37 | ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
|
---|
38 | ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
|
---|
39 |
|
---|
40 | <para>Compile the package:</para>
|
---|
41 |
|
---|
42 | <screen><userinput>make \
|
---|
43 | 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>
|
---|
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=/ \
|
---|
63 | EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id extras/firmware extras/floppy extras/scsi_id extras/usb_id extras/volume_id" \
|
---|
64 | install</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
|
---|
82 | the 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
|
---|
87 | modules.</para>
|
---|
88 |
|
---|
89 | <screen><userinput>sed -i 147,150d /etc/udev/rules.d/25-lfs.rules
|
---|
90 | cat >> /etc/udev/rules.d/25-lfs.rules << EOF
|
---|
91 | # Rules to allow hotplugging of devices with modular drivers
|
---|
92 | ACTION=="add", SUBSYSTEM=="usb", MODALIAS=="*", \
|
---|
93 | RUN+="/sbin/modprobe $modalias"
|
---|
94 | ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[07]", \
|
---|
95 | RUN+="/sbin/modprobe sd_mod"
|
---|
96 | EOF</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
|
---|
106 | complement 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>udevcontrol, udevd, udevinfo, udevmonitor, and udevtest</seg>
|
---|
118 | <seg>/etc/udev</seg></seglistitem>
|
---|
119 | </segmentedlist>
|
---|
120 |
|
---|
121 | <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
122 | <?dbfo list-presentation="list"?>
|
---|
123 | <?dbhtml list-presentation="table"?>
|
---|
124 |
|
---|
125 | <varlistentry id="udevcontrol">
|
---|
126 | <term><command>udevcontrol</command></term>
|
---|
127 | <listitem>
|
---|
128 | <para>Configures a number of options for the running <command>udevd</command>
|
---|
129 | daemon, such as the log level.</para>
|
---|
130 | <indexterm zone="ch-system-udev udevcontrol"><primary sortas="b-udevcontrol">udevcontrol</primary>
|
---|
131 | </indexterm>
|
---|
132 | </listitem></varlistentry>
|
---|
133 |
|
---|
134 | <varlistentry id="udevd">
|
---|
135 | <term><command>udevd</command></term>
|
---|
136 | <listitem>
|
---|
137 | <para>A daemon that reorders hotplug events before submitting them to
|
---|
138 | <command>udev</command>,
|
---|
139 | thus avoiding various race conditions</para>
|
---|
140 | <indexterm zone="ch-system-udev udevd"><primary sortas="b-udevd">udevd</primary></indexterm>
|
---|
141 | </listitem></varlistentry>
|
---|
142 |
|
---|
143 | <varlistentry id="udevinfo">
|
---|
144 | <term><command>udevinfo</command></term>
|
---|
145 | <listitem>
|
---|
146 | <para>Allows users to query the <command>udev</command> database for
|
---|
147 | information on any device currently present on the system; it also
|
---|
148 | provides a way to query any device in the <systemitem
|
---|
149 | class="filesystem">sysfs</systemitem> tree to help create udev
|
---|
150 | rules</para>
|
---|
151 | <indexterm zone="ch-system-udev udevinfo"><primary sortas="b-udevinfo">udevinfo</primary></indexterm>
|
---|
152 | </listitem></varlistentry>
|
---|
153 |
|
---|
154 | <varlistentry id="udevmonitor">
|
---|
155 | <term><command>udevmonitor</command></term>
|
---|
156 | <listitem>
|
---|
157 | <para>Prints the event received from the kernel and the event which
|
---|
158 | <command>udev</command> sends out after rule processing</para>
|
---|
159 | <indexterm zone="ch-system-udev udevmonitor"><primary sortas="b-udevmonitor">udevmonitor</primary>
|
---|
160 | </indexterm>
|
---|
161 | </listitem></varlistentry>
|
---|
162 |
|
---|
163 | <varlistentry id="udevtest">
|
---|
164 | <term><command>udevtest</command></term>
|
---|
165 | <listitem>
|
---|
166 | <para>Simulates a <command>udev</command> run for the given device,
|
---|
167 | and prints out the name of the node the real <command>udev</command> would
|
---|
168 | have created or (not in LFS) the name of the renamed network interface</para>
|
---|
169 | <indexterm zone="ch-system-udev udevtest"><primary sortas="b-udevtest">udevtest</primary></indexterm>
|
---|
170 | </listitem></varlistentry>
|
---|
171 |
|
---|
172 | <varlistentry id="etc-udev">
|
---|
173 | <term><filename class="directory">/etc/udev</filename></term>
|
---|
174 | <listitem>
|
---|
175 | <para>Contains <command>udev</command> configuation files,
|
---|
176 | device permissions, and rules for device naming</para>
|
---|
177 | <indexterm zone="ch-system-udev etc-udev"><primary sortas="e-/etc/udev">/etc/udev</primary></indexterm>
|
---|
178 | </listitem></varlistentry>
|
---|
179 | </variablelist>
|
---|
180 | </sect2>
|
---|
181 |
|
---|
182 | </sect1>
|
---|
183 |
|
---|