Update to Python-3.8.2.
[linux_from_scratch.git] / chapter06 / eudev.xml
blob742fa5dfda45c4f6f5f1f83bcc0a27acc6830610
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 ]>
8 <sect1 id="ch-system-eudev" role="wrap" revision="sysv">
9   <?dbhtml filename="eudev.html"?>
11   <sect1info condition="script">
12     <productname>eudev</productname>
13     <productnumber>&eudev-version;</productnumber>
14     <address>&eudev-url;</address>
15   </sect1info>
17   <title>Eudev-&eudev-version;</title>
19   <indexterm zone="ch-system-eudev">
20     <primary sortas="a-Eudev">Eudev</primary>
21   </indexterm>
23   <sect2 role="package">
24     <title/>
26     <para>The Eudev package contains programs for dynamic creation of device
27     nodes.</para> 
29     <segmentedlist>
30       <segtitle>&buildtime;</segtitle>
31       <segtitle>&diskspace;</segtitle>
33       <seglistitem>
34         <seg>&eudev-ch6-sbu;</seg>
35         <seg>&eudev-ch6-du;</seg>
36       </seglistitem>
37     </segmentedlist>
38   </sect2>
40   <sect2 role="installation">
41     <title>Installation of Eudev</title>
42 <!--
43     <para>First, fix a test script:</para>
45 <screen><userinput remap="pre">sed -r -i 's|/usr(/bin/test)|\1|' test/udev-test.pl</userinput></screen>
46 -->
47 <!--
48     <para>Next, remove an unneeded line that causes a build failure:</para>
50 <screen><userinput remap="pre">sed -i '/keyboard_lookup_key/d' src/udev/udev-builtin-keyboard.c</userinput></screen>
51 -->
52 <!--
53     <para>First, add a workaround to prevent the /tools directory from being 
54     hard coded into Eudev binary files library locations:</para>
56 <screen><userinput remap="pre">cat &gt; config.cache &lt;&lt; "EOF"
57 HAVE_BLKID=1
58 BLKID_LIBS="-lblkid"
59 BLKID_CFLAGS="-I/tools/include"
60 EOF</userinput></screen>
61 -->
62 <para>Prepare Eudev for compilation:</para>
64 <screen><userinput remap="configure">./configure --prefix=/usr           \
65             --bindir=/sbin          \
66             --sbindir=/sbin         \
67             --libdir=/usr/lib       \
68             --sysconfdir=/etc       \
69             --libexecdir=/lib       \
70             --with-rootprefix=      \
71             --with-rootlibdir=/lib  \
72             --enable-manpages       \
73             --disable-static</userinput></screen>
74 <!--           - -config-cache</userinput></screen> -->
76 <para>Compile the package:</para>
78 <screen><userinput remap="make">make</userinput></screen>
79 <!--
80 <screen><userinput remap="make">LIBRARY_PATH=/tools/lib make</userinput></screen>
82 <note><para>The LIBRARY_PATH variable here and the LD_LIBRARY_PATH variable
83 below are needed to allow the use of libraries that were installed in /tools,
84 but have not yet been installed in the main system.  LIBRARY_PATH is
85 used to find libraries during the linking process.  LD_LIBRARY_PATH is
86 used to find libraries during program execution.</para></note>
87 -->
88 <para>Create some directories now that are needed for tests, but
89 will also be used as a part of installation:</para>
91 <screen><userinput remap="test">mkdir -pv /lib/udev/rules.d
92 mkdir -pv /etc/udev/rules.d</userinput></screen>
94 <para>To test the results, issue:</para>
96 <screen><userinput remap="test">make check</userinput></screen>
97 <!--<screen><userinput remap="test">make LD_LIBRARY_PATH=/tools/lib check</userinput></screen>-->
99     <para>Install the package:</para>
101 <screen><userinput remap="install">make install</userinput></screen>
102 <!--<screen><userinput remap="install">make LD_LIBRARY_PATH=/tools/lib install</userinput></screen>-->
104     <para>Install some custom rules and support files useful in an LFS 
105     environment:</para>
107 <screen><userinput remap="install">tar -xvf ../&udev-lfs-version;.tar.xz
108 make -f &udev-lfs-version;/Makefile.lfs install</userinput></screen>
110   </sect2>
112   <sect2 id="conf-eudev" role="configuration">
113     <title>Configuring Eudev</title>
115     <indexterm zone="conf-eudev">
116       <primary sortas="a-Eudev">Eudev</primary>
117       <secondary>configuring</secondary>
118     </indexterm>
120     <indexterm zone="conf-eudev">
121       <primary sortas="e-/etc/udev/hwdb.bin">/etc/udev/hwdb.bin</primary>
122     </indexterm>
124     <para>Information about hardware devices is maintained in the
125     <filename class="directory">/etc/udev/hwdb.d</filename> and
126     <filename class="directory">/lib/udev/hwdb.d</filename> directories.
127     <application>Eudev</application> needs that information to be compiled
128     into a binary database <filename>/etc/udev/hwdb.bin</filename>. Create the
129     initial database:</para>
131 <!--<screen><userinput>LD_LIBRARY_PATH=/tools/lib udevadm hwdb - -update</userinput></screen>-->
132 <screen><userinput>udevadm hwdb --update</userinput></screen>
134     <para>This command needs to be run each time the hardware information is
135     updated.</para>
137   </sect2>
139   <sect2 id="contents-eudev" role="content">
140     <title>Contents of Eudev</title>
142     <segmentedlist>
143       <segtitle>Installed programs</segtitle>
144       <segtitle>Installed libraries</segtitle>
145       <segtitle>Installed directories</segtitle>
147       <seglistitem>
148         <seg><!-- These are in /lib/udev and not to be called by the user:
149          accelerometer, ata_id, cdrom_id, collect, mtd_probe,
150          scsi_id, v4l_id,--> udevadm and udevd</seg>
152         <seg>libudev.so</seg>
154         <seg>/etc/udev, /lib/udev, and /usr/share/doc/udev-&udev-lfs-version;</seg>
155       </seglistitem>
156     </segmentedlist>
158     <variablelist>
159       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
160       <?dbfo list-presentation="list"?>
161       <?dbhtml list-presentation="table"?>
162       <varlistentry id="udevadm" revision="sysv">
163         <term><command>udevadm</command></term>
164         <listitem>
165           <para>Generic udev administration tool: controls the udevd daemon,
166           provides info from the Udev database, monitors uevents, waits for
167           uevents to finish, tests Udev configuration, and triggers uevents
168           for a given device</para>
169           <indexterm zone="ch-system-eudev udevadm">
170             <primary sortas="b-udevadm">udevadm</primary>
171           </indexterm>
172         </listitem>
173       </varlistentry>
175       <varlistentry id="udevd">
176         <term><command>udevd</command></term>
177         <listitem>
178           <para>A daemon that listens for uevents on the netlink socket,
179           creates devices and runs the configured external programs in
180           response to these uevents</para>
181           <indexterm zone="ch-system-eudev udevd">
182             <primary sortas="b-udevd">udevd</primary>
183           </indexterm>
184         </listitem>
185       </varlistentry>
187       <varlistentry id="libudev">
188         <term><filename class="libraryfile">libudev</filename></term>
189         <listitem>
190           <para>A library interface to udev device information</para>
191           <indexterm zone="ch-system-eudev libudev">
192             <primary sortas="c-libudev">libudev</primary>
193           </indexterm>
194         </listitem>
195       </varlistentry>
197       <varlistentry id="etc-udev">
198         <term><filename class="directory">/etc/udev</filename></term>
199         <listitem>
200           <para>Contains Udev configuration files,
201           device permissions, and rules for device naming</para>
202           <indexterm zone="ch-system-eudev etc-udev">
203             <primary sortas="e-/etc/udev">/etc/udev</primary>
204           </indexterm>
205         </listitem>
206       </varlistentry>
208     </variablelist>
210   </sect2>
212 </sect1>