source: chapter08/udev.xml@ 870d24c

12.0 12.0-rc1 12.1 12.1-rc1 multilib trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/update-glibc
Last change on this file since 870d24c was 4ca4e8b, checked in by Xi Ruoyao <xry111@…>, 12 months ago

udev: Fix a typo

  • 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.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>Prepare Udev for compilation:</para>
55
56<screen><userinput remap="configure">mkdir -p build
57cd build
58
59meson setup \
60 --prefix=/usr \
61 --buildtype=release \
62 -Dmode=release \
63 -Ddev-kvm-mode=0660 \
64 -Dlink-udev-shared=false \
65 ..</userinput></screen>
66
67 <variablelist>
68 <title>The meaning of the meson options:</title>
69
70 <varlistentry>
71 <term><parameter>--buildtype=release</parameter></term>
72 <listitem>
73 <para>This switch overrides the default buildtype
74 (<quote>debug</quote>), which produces unoptimized
75 binaries.</para>
76 </listitem>
77 </varlistentry>
78
79 <varlistentry>
80 <term><parameter>-Dmode=release</parameter></term>
81 <listitem>
82 <para>Disable some features considered experimental by upstream.
83 </para>
84 </listitem>
85 </varlistentry>
86
87 <varlistentry>
88 <term><parameter>-Ddev-kvm-mode=0660</parameter></term>
89 <listitem>
90 <para>The default udev rule would allow all users to access
91 <filename class='devicefile'>/dev/kvm</filename>. The editors
92 consider it dangerous. This option overrides it.</para>
93 </listitem>
94 </varlistentry>
95
96 <varlistentry>
97 <term><parameter>-Dlink-udev-shared=false</parameter></term>
98 <listitem>
99 <para>This option prevents udev from linking to the internal
100 systemd shared library,
101 <systemitem class='library'>libsystemd-shared</systemitem>.
102 This library is designed to be shared by many Systemd components
103 and it's too overkill for a udev-only installation.</para>
104 </listitem>
105 </varlistentry>
106 </variablelist>
107
108 <para>Only build the components needed for udev:</para>
109
110 <screen><userinput remap="make">ninja udevadm systemd-hwdb \
111 $(grep -o -E "^build (src/libudev|src/udev|rules.d|hwdb.d)[^:]*" \
112 build.ninja | awk '{ print $2 }') \
113 $(realpath libudev.so --relative-to .)</userinput></screen>
114
115 <para>Install the package:</para>
116
117 <screen><userinput remap="install">install -vm755 -d {/usr/lib,/etc}/udev/{hwdb,rules}.d
118install -vm755 -d /usr/{lib,share}/pkgconfig
119install -vm755 udevadm /usr/bin/
120install -vm755 systemd-hwdb /usr/bin/udev-hwdb
121ln -sv ../bin/udevadm /usr/sbin/udevd
122cp -av libudev.so{,*[0-9]} /usr/lib/
123install -vm644 ../src/libudev/libudev.h /usr/include/
124install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/
125install -vm644 src/udev/*.pc /usr/share/pkgconfig/
126install -vm644 ../src/udev/udev.conf /etc/udev/
127install -vm644 rules.d/* ../rules.d/{*.rules,README} /usr/lib/udev/rules.d/
128install -vm644 hwdb.d/* ../hwdb.d/{*.hwdb,README} /usr/lib/udev/hwdb.d/
129install -vm755 $(find src/udev -type f | grep -F -v ".") /usr/lib/udev</userinput></screen>
130
131 <para>Install some custom rules and support files useful in an LFS
132 environment:</para>
133
134<screen><userinput remap="install">tar -xvf ../../&udev-lfs-version;.tar.xz
135make -f &udev-lfs-version;/Makefile.lfs install</userinput></screen>
136
137 <para>Install the man pages:</para>
138
139 <!-- Please make sure systemd man pages tarball has a common leading
140 component in the path. -->
141<screen><userinput remap="install">tar -xf ../../systemd-man-pages-253.tar.xz --strip-components=1 \
142 -C /usr/share/man --wildcards '*/udev*' '*/libudev*' \
143 '*/systemd-'{hwdb,udevd.service}.8
144sed 's/systemd\(\\\?-\)/udev-/' /usr/share/man/man8/systemd-hwdb.8 \
145 > /usr/share/man/man8/udev-hwdb.8
146sed 's|lib.*udevd|sbin/udevd|' \
147 /usr/share/man/man8/systemd-udevd.service.8 \
148 > /usr/share/man/man8/udevd.8
149rm /usr/share/man/man8/systemd-*.8</userinput></screen>
150
151 </sect2>
152
153 <sect2 id="conf-udev" role="configuration">
154 <title>Configuring Udev</title>
155
156 <indexterm zone="conf-udev">
157 <primary sortas="a-Udev">Udev</primary>
158 <secondary>configuring</secondary>
159 </indexterm>
160
161 <indexterm zone="conf-udev">
162 <primary sortas="e-/etc/udev/hwdb.bin">/etc/udev/hwdb.bin</primary>
163 </indexterm>
164
165 <para>Information about hardware devices is maintained in the
166 <filename class="directory">/etc/udev/hwdb.d</filename> and
167 <filename class="directory">/usr/lib/udev/hwdb.d</filename> directories.
168 <application>Udev</application> needs that information to be compiled
169 into a binary database <filename>/etc/udev/hwdb.bin</filename>. Create the
170 initial database:</para>
171
172<screen><userinput>udev-hwdb update</userinput></screen>
173
174 <para>This command needs to be run each time the hardware information is
175 updated.</para>
176
177 </sect2>
178
179 <sect2 id="contents-udev" role="content">
180 <title>Contents of Udev</title>
181
182 <segmentedlist>
183 <segtitle>Installed programs</segtitle>
184 <segtitle>Installed libraries</segtitle>
185 <segtitle>Installed directories</segtitle>
186
187 <seglistitem>
188 <seg>udevadm, udevd (symlink to udevadm), and udev-hwdb</seg>
189
190 <seg>libudev.so</seg>
191
192 <seg>/etc/udev and /usr/lib/udev</seg>
193 </seglistitem>
194 </segmentedlist>
195
196 <variablelist>
197 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
198 <?dbfo list-presentation="list"?>
199 <?dbhtml list-presentation="table"?>
200 <varlistentry id="udevadm" revision="sysv">
201 <term><command>udevadm</command></term>
202 <listitem>
203 <para>Generic udev administration tool: controls the udevd daemon,
204 provides info from the Udev database, monitors uevents, waits for
205 uevents to finish, tests Udev configuration, and triggers uevents
206 for a given device</para>
207 <indexterm zone="ch-system-udev udevadm">
208 <primary sortas="b-udevadm">udevadm</primary>
209 </indexterm>
210 </listitem>
211 </varlistentry>
212
213 <varlistentry id="udevd">
214 <term><command>udevd</command></term>
215 <listitem>
216 <para>A daemon that listens for uevents on the netlink socket,
217 creates devices and runs the configured external programs in
218 response to these uevents</para>
219 <indexterm zone="ch-system-udev udevd">
220 <primary sortas="b-udevd">udevd</primary>
221 </indexterm>
222 </listitem>
223 </varlistentry>
224
225 <varlistentry id="udev-hwdb">
226 <term><command>udev-hwdb</command></term>
227 <listitem>
228 <para>Updates or queries the hardware database.</para>
229 <indexterm zone="ch-system-udev udev-hwdb">
230 <primary sortas="b-udev-hwdb">udev-hwdb</primary>
231 </indexterm>
232 </listitem>
233 </varlistentry>
234
235 <varlistentry id="libudev">
236 <term><filename class="libraryfile">libudev</filename></term>
237 <listitem>
238 <para>A library interface to udev device information</para>
239 <indexterm zone="ch-system-udev libudev">
240 <primary sortas="c-libudev">libudev</primary>
241 </indexterm>
242 </listitem>
243 </varlistentry>
244
245 <varlistentry id="etc-udev">
246 <term><filename class="directory">/etc/udev</filename></term>
247 <listitem>
248 <para>Contains Udev configuration files,
249 device permissions, and rules for device naming</para>
250 <indexterm zone="ch-system-udev etc-udev">
251 <primary sortas="e-/etc/udev">/etc/udev</primary>
252 </indexterm>
253 </listitem>
254 </varlistentry>
255
256 </variablelist>
257
258 </sect2>
259
260</sect1>
Note: See TracBrowser for help on using the repository browser.