udev.xml 14 KB

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