udev.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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. <sect1 id="ch-system-udev" role="wrap">
  8. <?dbhtml filename="udev.html"?>
  9. <sect1info condition="script">
  10. <productname>udev</productname>
  11. <productnumber>&udev-version;</productnumber>
  12. <address>&udev-url;</address>
  13. </sect1info>
  14. <title>Udev-&udev-version;</title>
  15. <indexterm zone="ch-system-udev">
  16. <primary sortas="a-Udev">Udev</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>The Udev package contains programs for dynamic creation of device
  21. nodes.</para>
  22. <segmentedlist>
  23. <segtitle>&buildtime;</segtitle>
  24. <segtitle>&diskspace;</segtitle>
  25. <seglistitem>
  26. <seg>&udev-ch6-sbu;</seg>
  27. <seg>&udev-ch6-du;</seg>
  28. </seglistitem>
  29. </segmentedlist>
  30. </sect2>
  31. <sect2 role="installation">
  32. <title>Installation of Udev</title>
  33. <para>The udev-config tarball contains LFS-specific files used to configure
  34. Udev. Unpack it into the Udev source directory:</para>
  35. <screen><userinput remap="pre">tar -xvf ../&udev-config;.tar.bz2</userinput></screen>
  36. <para>Create some devices and directories that Udev cannot handle due to
  37. them being required very early in the boot process, or by Udev itself:</para>
  38. <screen><userinput remap="install">install -dv /lib/{firmware,udev/devices/{pts,shm}}
  39. mknod -m0666 /lib/udev/devices/null c 1 3
  40. mknod -m0600 /lib/udev/devices/kmsg c 1 11
  41. ln -sv /proc/self/fd /lib/udev/devices/fd
  42. ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
  43. ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
  44. ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
  45. ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
  46. <para>Prepare the package for compilation:</para>
  47. <!-- Note that "libdir=/usr/lib64" would be required for multilib. -->
  48. <screen><userinput remap="configure">./configure --prefix=/usr \
  49. --sysconfdir=/etc --sbindir=/sbin \
  50. --with-rootlibdir=/lib --libexecdir=/lib/udev \
  51. --disable-extras</userinput></screen>
  52. <variablelist>
  53. <title>The meaning of the new configure options</title>
  54. <varlistentry>
  55. <term><parameter>--with-rootlibdir=/lib</parameter></term>
  56. <listitem>
  57. <para>This controls where the <filename
  58. class="libraryfile">libudev</filename> library is installed. The
  59. library needs to be in <filename class="directory">/lib</filename>
  60. because it's used by Udev at boot time, before <filename
  61. class="directory">/usr</filename> might be available, and the default
  62. --rootlibdir is <filename class="directory">/usr/lib</filename>.</para>
  63. </listitem>
  64. </varlistentry>
  65. <!-- Note that libexecdir *MUST* stay /lib/udev, even on a 64-bit
  66. / multilib system where udev is compiled for 64-bit. Other
  67. packages require this exact path; the udev maintainers have
  68. said this is part of the udev API. -->
  69. <varlistentry>
  70. <term><parameter>--libexecdir=/lib/udev</parameter></term>
  71. <listitem>
  72. <para>This controls where Udev-internal rules and helper programs
  73. are installed.</para>
  74. </listitem>
  75. </varlistentry>
  76. <varlistentry>
  77. <term><parameter>--disable-extras</parameter></term>
  78. <listitem>
  79. <para>This option prevents Udev from installing helper programs and
  80. other extras which require more external libraries. These libraries
  81. are not part of the base LFS system. See the Udev
  82. <filename>README</filename> file for more information.</para>
  83. </listitem>
  84. </varlistentry>
  85. </variablelist>
  86. <para>Compile the package:</para>
  87. <screen><userinput remap="make">make</userinput></screen>
  88. <para>This package does not come with a test suite.</para>
  89. <para>Install the package:</para>
  90. <screen><userinput remap="install">make install</userinput></screen>
  91. <para>Udev has to be configured in order to work properly, as its default
  92. configuration does not cover all devices. First install two extra rules
  93. files from Udev to help support device-mapper and RAID setups:</para>
  94. <screen><userinput remap="install">install -m644 -v rules/packages/64-*.rules \
  95. /lib/udev/rules.d/</userinput></screen>
  96. <para>Now install a file to create symlinks for certain hand-held devices:</para>
  97. <screen><userinput remap="install">install -m644 -v rules/packages/40-pilot-links.rules \
  98. /lib/udev/rules.d/</userinput></screen>
  99. <para>Now install a file to handle ISDN devices:</para>
  100. <screen><userinput remap="install">install -m644 -v rules/packages/40-isdn.rules \
  101. /lib/udev/rules.d/</userinput></screen>
  102. <!-- There are more files available in the packages/ directory, if we want
  103. to consider using them. Most are probably irrelevant to LFS though.
  104. "alsa" isn't, but we already have those rules, using a better set of
  105. matches. Most of the files in packages/ are for other architectures. -->
  106. <para>Now install the LFS-specific custom rules files:</para>
  107. <screen><userinput remap="install">cd &udev-config;
  108. make install</userinput></screen>
  109. <para>Install the documentation that explains the LFS-specific rules
  110. files:</para>
  111. <screen><userinput remap="install">make install-doc</userinput></screen>
  112. <para>Install the documentation that explains the commonly-used rules
  113. files provided by Udev:</para>
  114. <screen><userinput remap="install">make install-extra-doc</userinput></screen>
  115. <!--
  116. <para>Install the documentation that explains how to create custom Udev
  117. rules:</para>
  118. <screen><userinput remap="install">cd ..
  119. install -m644 -v -D docs/writing_udev_rules/index.html \
  120. /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
  121. -->
  122. </sect2>
  123. <sect2 id="contents-udev" role="content">
  124. <title>Contents of Udev</title>
  125. <segmentedlist>
  126. <segtitle>Installed programs</segtitle>
  127. <segtitle>Installed libraries</segtitle>
  128. <segtitle>Installed directory</segtitle>
  129. <seglistitem>
  130. <seg>ata_id, cdrom_id, collect, create_floppy_devices, edd_id,
  131. firmware.sh, fstab_import, path_id, scsi_id, udevadm, udevd,
  132. usb_id, write_cd_rules, and write_net_rules</seg>
  133. <seg>libudev</seg>
  134. <seg>/etc/udev</seg>
  135. </seglistitem>
  136. </segmentedlist>
  137. <variablelist>
  138. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  139. <?dbfo list-presentation="list"?>
  140. <?dbhtml list-presentation="table"?>
  141. <varlistentry id="ata_id">
  142. <term><command>ata_id</command></term>
  143. <listitem>
  144. <para>Provides Udev with a unique string and
  145. additional information (uuid, label) for an ATA drive</para>
  146. <indexterm zone="ch-system-udev ata_id">
  147. <primary sortas="b-ata_id">ata_id</primary>
  148. </indexterm>
  149. </listitem>
  150. </varlistentry>
  151. <varlistentry id="cdrom_id">
  152. <term><command>cdrom_id</command></term>
  153. <listitem>
  154. <para>Provides Udev with the capabilities of a
  155. CD-ROM or DVD-ROM drive</para>
  156. <indexterm zone="ch-system-udev cdrom_id">
  157. <primary sortas="b-cdrom_id">cdrom_id</primary>
  158. </indexterm>
  159. </listitem>
  160. </varlistentry>
  161. <varlistentry id="collect">
  162. <term><command>collect</command></term>
  163. <listitem>
  164. <para>Given an ID for the current uevent and a list of
  165. IDs (for all target uevents), registers the current ID
  166. and indicates whether all target IDs have been registered</para>
  167. <indexterm zone="ch-system-udev collect">
  168. <primary sortas="b-collect">collect</primary>
  169. </indexterm>
  170. </listitem>
  171. </varlistentry>
  172. <varlistentry id="create_floppy_devices">
  173. <term><command>create_floppy_devices</command></term>
  174. <listitem>
  175. <para>Creates all possible floppy devices based on the CMOS type</para>
  176. <indexterm zone="ch-system-udev create_floppy_devices">
  177. <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
  178. </indexterm>
  179. </listitem>
  180. </varlistentry>
  181. <varlistentry id="edd_id">
  182. <term><command>edd_id</command></term>
  183. <listitem>
  184. <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
  185. <indexterm zone="ch-system-udev edd_id">
  186. <primary sortas="b-edd_id">edd_id</primary>
  187. </indexterm>
  188. </listitem>
  189. </varlistentry>
  190. <varlistentry id="firmware.sh">
  191. <term><command>firmware.sh</command></term>
  192. <listitem>
  193. <para>Uploads firmware to devices</para>
  194. <indexterm zone="ch-system-udev firmware.sh">
  195. <primary sortas="b-firmware.sh">firmware.sh</primary>
  196. </indexterm>
  197. </listitem>
  198. </varlistentry>
  199. <varlistentry id="fstab_import">
  200. <term><command>fstab_import</command></term>
  201. <listitem>
  202. <para>Finds an entry in <filename>/etc/fstab</filename> that
  203. matches the current device, and provides its information to
  204. Udev</para>
  205. <indexterm zone="ch-system-udev fstab_import">
  206. <primary sortas="b-fstab_import">fstab_import</primary>
  207. </indexterm>
  208. </listitem>
  209. </varlistentry>
  210. <varlistentry id="path_id">
  211. <term><command>path_id</command></term>
  212. <listitem>
  213. <para>Provides the shortest possible unique hardware path to a
  214. device</para>
  215. <indexterm zone="ch-system-udev path_id">
  216. <primary sortas="b-path_id">path_id</primary>
  217. </indexterm>
  218. </listitem>
  219. </varlistentry>
  220. <varlistentry id="scsi_id">
  221. <term><command>scsi_id</command></term>
  222. <listitem>
  223. <para>Provides Udev with a unique SCSI identifier
  224. based on the data returned from sending a SCSI INQUIRY command to
  225. the specified device</para>
  226. <indexterm zone="ch-system-udev scsi_id">
  227. <primary sortas="b-scsi_id">scsi_id</primary>
  228. </indexterm>
  229. </listitem>
  230. </varlistentry>
  231. <varlistentry id="udevadm">
  232. <term><command>udevadm</command></term>
  233. <listitem>
  234. <para>Generic udev administration tool: controls the udevd daemon,
  235. provides info from the Udev database, monitors uevents, waits for
  236. uevents to finish, tests Udev configuration, and triggers uevents
  237. for a given device</para>
  238. <indexterm zone="ch-system-udev udevadm">
  239. <primary sortas="b-udevadm">udevadm</primary>
  240. </indexterm>
  241. </listitem>
  242. </varlistentry>
  243. <varlistentry id="udevd">
  244. <term><command>udevd</command></term>
  245. <listitem>
  246. <para>A daemon that listens for uevents on the netlink socket,
  247. creates devices and runs the configured external programs in
  248. response to these uevents</para>
  249. <indexterm zone="ch-system-udev udevd">
  250. <primary sortas="b-udevd">udevd</primary>
  251. </indexterm>
  252. </listitem>
  253. </varlistentry>
  254. <varlistentry id="usb_id">
  255. <term><command>usb_id</command></term>
  256. <listitem>
  257. <para>Provides Udev with information about USB
  258. devices</para>
  259. <indexterm zone="ch-system-udev usb_id">
  260. <primary sortas="b-usb_id">usb_id</primary>
  261. </indexterm>
  262. </listitem>
  263. </varlistentry>
  264. <varlistentry id="write_cd_rules">
  265. <term><command>write_cd_rules</command></term>
  266. <listitem>
  267. <para>A script which generates Udev rules to provide stable names for
  268. optical drives (see also <xref linkend="ch-scripts-symlinks"/>)</para>
  269. <indexterm zone="ch-system-udev write_cd_rules">
  270. <primary sortas="b-write_cd_rules">write_cd_rules</primary>
  271. </indexterm>
  272. </listitem>
  273. </varlistentry>
  274. <varlistentry id="write_net_rules">
  275. <term><command>write_net_rules</command></term>
  276. <listitem>
  277. <para>A script which generates rules to provide stable names for
  278. network interfaces (see also <xref linkend="ch-scripts-network"/>)
  279. </para>
  280. <indexterm zone="ch-system-udev write_net_rules">
  281. <primary sortas="b-write_net_rules">write_net_rules</primary>
  282. </indexterm>
  283. </listitem>
  284. </varlistentry>
  285. <varlistentry id="libudev">
  286. <term><command>libudev</command></term>
  287. <listitem>
  288. <para>A library interface to udev device information</para>
  289. <indexterm zone="ch-system-udev libudev">
  290. <primary sortas="c-libudev">libudev</primary>
  291. </indexterm>
  292. </listitem>
  293. </varlistentry>
  294. <varlistentry id="etc-udev">
  295. <term><filename class="directory">/etc/udev</filename></term>
  296. <listitem>
  297. <para>Contains Udev configuration files,
  298. device permissions, and rules for device naming</para>
  299. <indexterm zone="ch-system-udev etc-udev">
  300. <primary sortas="e-/etc/udev">/etc/udev</primary>
  301. </indexterm>
  302. </listitem>
  303. </varlistentry>
  304. </variablelist>
  305. </sect2>
  306. </sect1>