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" revision="sysv">
|
---|
9 | <?dbhtml filename="udev.html"?>
|
---|
10 |
|
---|
11 | <sect1info condition="script">
|
---|
12 | <productname>udev</productname>
|
---|
13 | <productnumber>&systemd-version;</productnumber>
|
---|
14 | <address>&systemd-url;</address>
|
---|
15 | </sect1info>
|
---|
16 |
|
---|
17 | <title>Udev from Systemd-&systemd-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-fin-sbu;</seg>
|
---|
35 | <seg>&udev-fin-du;</seg>
|
---|
36 | </seglistitem>
|
---|
37 | </segmentedlist>
|
---|
38 | </sect2>
|
---|
39 |
|
---|
40 | <sect2 role="installation">
|
---|
41 | <title>Installation of Udev</title>
|
---|
42 |
|
---|
43 | <para>Udev is part of the systemd-&systemd-version; package. Use
|
---|
44 | the systemd-&systemd-version;.tar.xz file as the source tarball.</para>
|
---|
45 |
|
---|
46 | <para>Remove two unneeded groups,
|
---|
47 | <systemitem class="groupname">render</systemitem> and
|
---|
48 | <systemitem class="groupname">sgx</systemitem>, from the default udev
|
---|
49 | rules:</para>
|
---|
50 |
|
---|
51 | <screen><userinput remap="pre">sed -i -e 's/GROUP="render"/GROUP="video"/' \
|
---|
52 | -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in</userinput></screen>
|
---|
53 |
|
---|
54 | <para>Remove one udev rule requiring a full Systemd installation:</para>
|
---|
55 |
|
---|
56 | <screen><userinput remap="pre">sed '/systemd-sysctl/s/^/#/' -i rules.d/99-systemd.rules.in</userinput></screen>
|
---|
57 |
|
---|
58 | <para>Prepare Udev for compilation:</para>
|
---|
59 |
|
---|
60 | <screen><userinput remap="configure">mkdir -p build
|
---|
61 | cd build
|
---|
62 |
|
---|
63 | meson setup \
|
---|
64 | --prefix=/usr \
|
---|
65 | --buildtype=release \
|
---|
66 | -Dmode=release \
|
---|
67 | -Ddev-kvm-mode=0660 \
|
---|
68 | -Dlink-udev-shared=false \
|
---|
69 | ..</userinput></screen>
|
---|
70 |
|
---|
71 | <variablelist>
|
---|
72 | <title>The meaning of the meson options:</title>
|
---|
73 |
|
---|
74 | <varlistentry>
|
---|
75 | <term><parameter>--buildtype=release</parameter></term>
|
---|
76 | <listitem>
|
---|
77 | <para>This switch overrides the default buildtype
|
---|
78 | (<quote>debug</quote>), which produces unoptimized
|
---|
79 | binaries.</para>
|
---|
80 | </listitem>
|
---|
81 | </varlistentry>
|
---|
82 |
|
---|
83 | <varlistentry>
|
---|
84 | <term><parameter>-Dmode=release</parameter></term>
|
---|
85 | <listitem>
|
---|
86 | <para>Disable some features considered experimental by upstream.
|
---|
87 | </para>
|
---|
88 | </listitem>
|
---|
89 | </varlistentry>
|
---|
90 |
|
---|
91 | <varlistentry>
|
---|
92 | <term><parameter>-Ddev-kvm-mode=0660</parameter></term>
|
---|
93 | <listitem>
|
---|
94 | <para>The default udev rule would allow all users to access
|
---|
95 | <filename class='devicefile'>/dev/kvm</filename>. The editors
|
---|
96 | consider it dangerous. This option overrides it.</para>
|
---|
97 | </listitem>
|
---|
98 | </varlistentry>
|
---|
99 |
|
---|
100 | <varlistentry>
|
---|
101 | <term><parameter>-Dlink-udev-shared=false</parameter></term>
|
---|
102 | <listitem>
|
---|
103 | <para>This option prevents udev from linking to the internal
|
---|
104 | systemd shared library,
|
---|
105 | <systemitem class='library'>libsystemd-shared</systemitem>.
|
---|
106 | This library is designed to be shared by many Systemd components
|
---|
107 | and it's too overkill for a udev-only installation.</para>
|
---|
108 | </listitem>
|
---|
109 | </varlistentry>
|
---|
110 | </variablelist>
|
---|
111 |
|
---|
112 | <para>Only build the components needed for udev:</para>
|
---|
113 |
|
---|
114 | <screen><userinput remap="make">ninja udevadm systemd-hwdb \
|
---|
115 | $(grep -o -E "^build (src/libudev|src/udev|rules.d|hwdb.d)[^:]*" \
|
---|
116 | build.ninja | awk '{ print $2 }') \
|
---|
117 | $(realpath libudev.so --relative-to .)</userinput></screen>
|
---|
118 |
|
---|
119 | <para>Remove one udev rule file requiring a full Systemd
|
---|
120 | installation:</para>
|
---|
121 |
|
---|
122 | <screen><userinput remap="make">rm rules.d/90-vconsole.rules</userinput></screen>
|
---|
123 |
|
---|
124 | <para>Install the package:</para>
|
---|
125 |
|
---|
126 | <screen><userinput remap="install">install -vm755 -d {/usr/lib,/etc}/udev/{hwdb,rules}.d
|
---|
127 | install -vm755 -d /usr/{lib,share}/pkgconfig
|
---|
128 | install -vm755 udevadm /usr/bin/
|
---|
129 | install -vm755 systemd-hwdb /usr/bin/udev-hwdb
|
---|
130 | ln -svfn ../bin/udevadm /usr/sbin/udevd
|
---|
131 | cp -av libudev.so{,*[0-9]} /usr/lib/
|
---|
132 | install -vm644 ../src/libudev/libudev.h /usr/include/
|
---|
133 | install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/
|
---|
134 | install -vm644 src/udev/*.pc /usr/share/pkgconfig/
|
---|
135 | install -vm644 ../src/udev/udev.conf /etc/udev/
|
---|
136 | install -vm644 rules.d/* ../rules.d/{*.rules,README} /usr/lib/udev/rules.d/
|
---|
137 | install -vm644 hwdb.d/* ../hwdb.d/{*.hwdb,README} /usr/lib/udev/hwdb.d/
|
---|
138 | install -vm755 $(find src/udev -type f | grep -F -v ".") /usr/lib/udev</userinput></screen>
|
---|
139 |
|
---|
140 | <para>Install some custom rules and support files useful in an LFS
|
---|
141 | environment:</para>
|
---|
142 |
|
---|
143 | <screen><userinput remap="install">tar -xvf ../../&udev-lfs-version;.tar.xz
|
---|
144 | make -f &udev-lfs-version;/Makefile.lfs install</userinput></screen>
|
---|
145 |
|
---|
146 | <para>Install the man pages:</para>
|
---|
147 |
|
---|
148 | <!-- Please make sure systemd man pages tarball has a common leading
|
---|
149 | component in the path. -->
|
---|
150 | <screen><userinput remap="install">tar -xf ../../systemd-man-pages-&systemd-man-version;.tar.xz \
|
---|
151 | --no-same-owner --strip-components=1 \
|
---|
152 | -C /usr/share/man --wildcards '*/udev*' '*/libudev*' \
|
---|
153 | '*/systemd-'{hwdb,udevd.service}.8
|
---|
154 | sed 's/systemd\(\\\?-\)/udev\1/' /usr/share/man/man8/systemd-hwdb.8 \
|
---|
155 | > /usr/share/man/man8/udev-hwdb.8
|
---|
156 | sed 's|lib.*udevd|sbin/udevd|' \
|
---|
157 | /usr/share/man/man8/systemd-udevd.service.8 \
|
---|
158 | > /usr/share/man/man8/udevd.8
|
---|
159 | rm /usr/share/man/man8/systemd-*.8</userinput></screen>
|
---|
160 |
|
---|
161 | </sect2>
|
---|
162 |
|
---|
163 | <!-- - - - - - - - - - -->
|
---|
164 | <!-- Multilib - 32bit -->
|
---|
165 | <!-- - - - - - - - - - -->
|
---|
166 | <sect2 arch="ml_32,ml_all" role="installation">
|
---|
167 | <title>Installation of Udev - 32bit</title>
|
---|
168 |
|
---|
169 | <para>Clean previous build (while still in the build directory):</para>
|
---|
170 |
|
---|
171 | <screen><userinput remap="pre">rm -rf *</userinput></screen>
|
---|
172 |
|
---|
173 | <para>Prepare File for compilation:</para>
|
---|
174 |
|
---|
175 | <screen><userinput remap="configure">PKG_CONFIG_PATH="/usr/lib32/pkgconfig" \
|
---|
176 | CC="gcc -m32 -march=i686" \
|
---|
177 | CXX="g++ -m32 -march=i686" \
|
---|
178 | LANG=en_US.UTF-8 \
|
---|
179 | meson setup \
|
---|
180 | --prefix=/usr \
|
---|
181 | --buildtype=release \
|
---|
182 | -Dmode=release \
|
---|
183 | -Ddev-kvm-mode=0660 \
|
---|
184 | -Dlink-udev-shared=false \
|
---|
185 | ..</userinput></screen>
|
---|
186 |
|
---|
187 | <para>Compile the package:</para>
|
---|
188 |
|
---|
189 | <screen><userinput remap="make">ninja \
|
---|
190 | $(grep -o -E "^build (src/libudev|src/udev)[^:]*" \
|
---|
191 | build.ninja | awk '{ print $2 }') \
|
---|
192 | $(realpath libudev.so --relative-to .)</userinput></screen>
|
---|
193 |
|
---|
194 | <para>Install the package:</para>
|
---|
195 |
|
---|
196 | <screen><userinput remap="install">mkdir -pv /usr/lib32/pkgconfig &&
|
---|
197 | cp -av libudev.so{,*[0-9]} /usr/lib32/ &&
|
---|
198 | sed -e "s;/usr/lib;&32;g" src/libudev/libudev.pc > /usr/lib32/pkgconfig/libudev.pc</userinput></screen>
|
---|
199 |
|
---|
200 | </sect2><!-- m32 -->
|
---|
201 |
|
---|
202 | <!-- - - - - - - - - - -->
|
---|
203 | <!-- Multilib - x32bit -->
|
---|
204 | <!-- - - - - - - - - - -->
|
---|
205 | <sect2 arch="ml_x32,ml_all" role="installation">
|
---|
206 | <title>Installation of Udev - x32bit</title>
|
---|
207 | <para>Clean previous build (while still in the build directory):</para>
|
---|
208 |
|
---|
209 | <screen><userinput remap="pre">rm -rf *</userinput></screen>
|
---|
210 |
|
---|
211 | <para>Prepare File for compilation:</para>
|
---|
212 |
|
---|
213 | <screen><userinput remap="configure">PKG_CONFIG_PATH="/usr/libx32/pkgconfig" \
|
---|
214 | CC="gcc -mx32" \
|
---|
215 | CXX="g++ -mx32" \
|
---|
216 | CFLAGS+=" -Wno-error=shift-overflow" \
|
---|
217 | CXXFLAGS+=" -Wno-error=shift-overflow" \
|
---|
218 | LANG=en_US.UTF-8 \
|
---|
219 | meson setup \
|
---|
220 | --prefix=/usr \
|
---|
221 | --buildtype=release \
|
---|
222 | -Dmode=release \
|
---|
223 | -Ddev-kvm-mode=0660 \
|
---|
224 | -Dlink-udev-shared=false \
|
---|
225 | ..</userinput></screen>
|
---|
226 |
|
---|
227 | <para>Compile the package:</para>
|
---|
228 |
|
---|
229 | <screen><userinput remap="make">ninja \
|
---|
230 | $(grep -o -E "^build (src/libudev|src/udev)[^:]*" \
|
---|
231 | build.ninja | awk '{ print $2 }') \
|
---|
232 | $(realpath libudev.so --relative-to .)</userinput></screen>
|
---|
233 |
|
---|
234 | <para>Install the package:</para>
|
---|
235 |
|
---|
236 | <screen><userinput remap="install">mkdir -pv /usr/libx32/pkgconfig &&
|
---|
237 | cp -av libudev.so{,*[0-9]} /usr/libx32/ &&
|
---|
238 | sed -e "s;/usr/lib;&x32;g" src/libudev/libudev.pc > /usr/libx32/pkgconfig/libudev.pc</userinput></screen>
|
---|
239 |
|
---|
240 | </sect2><!-- mx32 -->
|
---|
241 |
|
---|
242 | <sect2 id="conf-udev" role="configuration">
|
---|
243 | <title>Configuring Udev</title>
|
---|
244 |
|
---|
245 | <indexterm zone="conf-udev">
|
---|
246 | <primary sortas="a-Udev">Udev</primary>
|
---|
247 | <secondary>configuring</secondary>
|
---|
248 | </indexterm>
|
---|
249 |
|
---|
250 | <indexterm zone="conf-udev">
|
---|
251 | <primary sortas="e-/etc/udev/hwdb.bin">/etc/udev/hwdb.bin</primary>
|
---|
252 | </indexterm>
|
---|
253 |
|
---|
254 | <para>Information about hardware devices is maintained in the
|
---|
255 | <filename class="directory">/etc/udev/hwdb.d</filename> and
|
---|
256 | <filename class="directory">/usr/lib/udev/hwdb.d</filename> directories.
|
---|
257 | <application>Udev</application> needs that information to be compiled
|
---|
258 | into a binary database <filename>/etc/udev/hwdb.bin</filename>. Create the
|
---|
259 | initial database:</para>
|
---|
260 |
|
---|
261 | <screen><userinput>udev-hwdb update</userinput></screen>
|
---|
262 |
|
---|
263 | <para>This command needs to be run each time the hardware information is
|
---|
264 | updated.</para>
|
---|
265 |
|
---|
266 | </sect2>
|
---|
267 |
|
---|
268 | <sect2 id="contents-udev" role="content">
|
---|
269 | <title>Contents of Udev</title>
|
---|
270 |
|
---|
271 | <segmentedlist>
|
---|
272 | <segtitle>Installed programs</segtitle>
|
---|
273 | <segtitle>Installed libraries</segtitle>
|
---|
274 | <segtitle>Installed directories</segtitle>
|
---|
275 |
|
---|
276 | <seglistitem>
|
---|
277 | <seg>udevadm, udevd (symlink to udevadm), and udev-hwdb</seg>
|
---|
278 |
|
---|
279 | <seg>libudev.so</seg>
|
---|
280 |
|
---|
281 | <seg>/etc/udev and /usr/lib/udev</seg>
|
---|
282 | </seglistitem>
|
---|
283 | </segmentedlist>
|
---|
284 |
|
---|
285 | <variablelist>
|
---|
286 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
287 | <?dbfo list-presentation="list"?>
|
---|
288 | <?dbhtml list-presentation="table"?>
|
---|
289 | <varlistentry id="udevadm" revision="sysv">
|
---|
290 | <term><command>udevadm</command></term>
|
---|
291 | <listitem>
|
---|
292 | <para>Generic udev administration tool: controls the udevd daemon,
|
---|
293 | provides info from the Udev database, monitors uevents, waits for
|
---|
294 | uevents to finish, tests Udev configuration, and triggers uevents
|
---|
295 | for a given device</para>
|
---|
296 | <indexterm zone="ch-system-udev udevadm">
|
---|
297 | <primary sortas="b-udevadm">udevadm</primary>
|
---|
298 | </indexterm>
|
---|
299 | </listitem>
|
---|
300 | </varlistentry>
|
---|
301 |
|
---|
302 | <varlistentry id="udevd">
|
---|
303 | <term><command>udevd</command></term>
|
---|
304 | <listitem>
|
---|
305 | <para>A daemon that listens for uevents on the netlink socket,
|
---|
306 | creates devices and runs the configured external programs in
|
---|
307 | response to these uevents</para>
|
---|
308 | <indexterm zone="ch-system-udev udevd">
|
---|
309 | <primary sortas="b-udevd">udevd</primary>
|
---|
310 | </indexterm>
|
---|
311 | </listitem>
|
---|
312 | </varlistentry>
|
---|
313 |
|
---|
314 | <varlistentry id="udev-hwdb">
|
---|
315 | <term><command>udev-hwdb</command></term>
|
---|
316 | <listitem>
|
---|
317 | <para>Updates or queries the hardware database.</para>
|
---|
318 | <indexterm zone="ch-system-udev udev-hwdb">
|
---|
319 | <primary sortas="b-udev-hwdb">udev-hwdb</primary>
|
---|
320 | </indexterm>
|
---|
321 | </listitem>
|
---|
322 | </varlistentry>
|
---|
323 |
|
---|
324 | <varlistentry id="libudev">
|
---|
325 | <term><filename class="libraryfile">libudev</filename></term>
|
---|
326 | <listitem>
|
---|
327 | <para>A library interface to udev device information</para>
|
---|
328 | <indexterm zone="ch-system-udev libudev">
|
---|
329 | <primary sortas="c-libudev">libudev</primary>
|
---|
330 | </indexterm>
|
---|
331 | </listitem>
|
---|
332 | </varlistentry>
|
---|
333 |
|
---|
334 | <varlistentry id="etc-udev">
|
---|
335 | <term><filename class="directory">/etc/udev</filename></term>
|
---|
336 | <listitem>
|
---|
337 | <para>Contains Udev configuration files,
|
---|
338 | device permissions, and rules for device naming</para>
|
---|
339 | <indexterm zone="ch-system-udev etc-udev">
|
---|
340 | <primary sortas="e-/etc/udev">/etc/udev</primary>
|
---|
341 | </indexterm>
|
---|
342 | </listitem>
|
---|
343 | </varlistentry>
|
---|
344 |
|
---|
345 | </variablelist>
|
---|
346 |
|
---|
347 | </sect2>
|
---|
348 |
|
---|
349 | </sect1>
|
---|