udev.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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:</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. ln -sv /proc/self/fd /lib/udev/devices/fd
  41. ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
  42. ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
  43. ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
  44. ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
  45. <para><command>usb_id</command> is known to segfault under certain kernel
  46. configurations. Fix the issue by applying the following patch:</para>
  47. <screen><userinput remap="pre">patch -Np1 -i ../&udev-usbid-patch;</userinput></screen>
  48. <para>Compile the package:</para>
  49. <screen><userinput remap="make">make EXTRAS="`echo extras/*/`"</userinput></screen>
  50. <variablelist>
  51. <title>The meaning of the make option:</title>
  52. <varlistentry>
  53. <term><parameter>EXTRAS=...</parameter></term>
  54. <listitem>
  55. <para>This builds the helper binaries that can aid in writing custom
  56. Udev rules.</para>
  57. </listitem>
  58. </varlistentry>
  59. </variablelist>
  60. <para>To test the results, issue:</para>
  61. <screen><userinput remap="test">make test</userinput></screen>
  62. <para>Note that the Udev testsuite will produce numerous messages in
  63. the host system's logs. These are harmless and can be ignored.</para>
  64. <para>Install the package:</para>
  65. <screen><userinput remap="install">make DESTDIR=/ EXTRAS="`echo extras/*/`" install</userinput></screen>
  66. <variablelist>
  67. <title>The meaning of the make parameter:</title>
  68. <varlistentry>
  69. <term><parameter>DESTDIR=/</parameter></term>
  70. <listitem>
  71. <para>This prevents the Udev build process from killing any
  72. <command>udevd</command> processes that may be running on the
  73. host system.</para>
  74. </listitem>
  75. </varlistentry>
  76. </variablelist>
  77. <para>Udev has to be configured in order to work properly, as it only
  78. installs a few configuration files by default. First install the
  79. commonly-used rules files provided by Udev:</para>
  80. <screen><userinput remap="install">cp -v etc/udev/rules.d/[0-9]* /etc/udev/rules.d/</userinput></screen>
  81. <para>Now install the LFS-specific rules files:</para>
  82. <screen><userinput remap="install">cd &udev-config;
  83. make install</userinput></screen>
  84. <para>Install the documentation that explains the LFS-specific rules
  85. files:</para>
  86. <screen><userinput remap="install">make install-doc</userinput></screen>
  87. <para>Install the documentation that explains the commonly-used rules
  88. files provided by Udev:</para>
  89. <screen><userinput remap="install">make install-extra-doc</userinput></screen>
  90. <para>Install the documentation that explains how to create custom Udev
  91. rules:</para>
  92. <screen><userinput remap="install">cd ..
  93. install -m644 -v docs/writing_udev_rules/index.html \
  94. /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
  95. </sect2>
  96. <sect2 id="contents-udev" role="content">
  97. <title>Contents of Udev</title>
  98. <segmentedlist>
  99. <segtitle>Installed programs</segtitle>
  100. <segtitle>Installed libraries</segtitle>
  101. <segtitle>Installed directory</segtitle>
  102. <seglistitem>
  103. <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware.sh,
  104. path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle,
  105. udevtest, udevtrigger, usb_id, vol_id, write_cd_rules, and
  106. write_net_rules</seg>
  107. <seg>libvolume_id</seg>
  108. <seg>/etc/udev</seg>
  109. </seglistitem>
  110. </segmentedlist>
  111. <variablelist>
  112. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  113. <?dbfo list-presentation="list"?>
  114. <?dbhtml list-presentation="table"?>
  115. <varlistentry id="ata_id">
  116. <term><command>ata_id</command></term>
  117. <listitem>
  118. <para>Provides Udev with a unique string and
  119. additional information (uuid, label) for an ATA drive</para>
  120. <indexterm zone="ch-system-udev ata_id">
  121. <primary sortas="b-ata_id">ata_id</primary>
  122. </indexterm>
  123. </listitem>
  124. </varlistentry>
  125. <varlistentry id="cdrom_id">
  126. <term><command>cdrom_id</command></term>
  127. <listitem>
  128. <para>Provides Udev with the capabilities of a
  129. CD-ROM or DVD-ROM drive</para>
  130. <indexterm zone="ch-system-udev cdrom_id">
  131. <primary sortas="b-cdrom_id">cdrom_id</primary>
  132. </indexterm>
  133. </listitem>
  134. </varlistentry>
  135. <varlistentry id="create_floppy_devices">
  136. <term><command>create_floppy_devices</command></term>
  137. <listitem>
  138. <para>Creates all possible floppy devices based on the CMOS type</para>
  139. <indexterm zone="ch-system-udev create_floppy_devices">
  140. <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
  141. </indexterm>
  142. </listitem>
  143. </varlistentry>
  144. <varlistentry id="edd_id">
  145. <term><command>edd_id</command></term>
  146. <listitem>
  147. <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
  148. <indexterm zone="ch-system-udev edd_id">
  149. <primary sortas="b-edd_id">edd_id</primary>
  150. </indexterm>
  151. </listitem>
  152. </varlistentry>
  153. <varlistentry id="firmware.sh">
  154. <term><command>firmware.sh</command></term>
  155. <listitem>
  156. <para>Uploads firmware to devices</para>
  157. <indexterm zone="ch-system-udev firmware.sh">
  158. <primary sortas="b-firmware.sh">firmware.sh</primary>
  159. </indexterm>
  160. </listitem>
  161. </varlistentry>
  162. <varlistentry id="path_id">
  163. <term><command>path_id</command></term>
  164. <listitem>
  165. <para>Provides the shortest possible unique hardware path to a
  166. device</para>
  167. <indexterm zone="ch-system-udev path_id">
  168. <primary sortas="b-path_id">path_id</primary>
  169. </indexterm>
  170. </listitem>
  171. </varlistentry>
  172. <varlistentry id="scsi_id">
  173. <term><command>scsi_id</command></term>
  174. <listitem>
  175. <para>Provides Udev with a unique SCSI identifier
  176. based on the data returned from sending a SCSI INQUIRY command to
  177. the specified device</para>
  178. <indexterm zone="ch-system-udev scsi_id">
  179. <primary sortas="b-scsi_id">scsi_id</primary>
  180. </indexterm>
  181. </listitem>
  182. </varlistentry>
  183. <varlistentry id="udevcontrol">
  184. <term><command>udevcontrol</command></term>
  185. <listitem>
  186. <para>Configures a number of options for the running
  187. <command>udevd</command> daemon, such as the log level.</para>
  188. <indexterm zone="ch-system-udev udevcontrol">
  189. <primary sortas="b-udevcontrol">udevcontrol</primary>
  190. </indexterm>
  191. </listitem>
  192. </varlistentry>
  193. <varlistentry id="udevd">
  194. <term><command>udevd</command></term>
  195. <listitem>
  196. <para>A daemon that listens for uevents on the netlink socket,
  197. creates devices and runs the configured external programs in
  198. response to these uevents</para>
  199. <indexterm zone="ch-system-udev udevd">
  200. <primary sortas="b-udevd">udevd</primary>
  201. </indexterm>
  202. </listitem>
  203. </varlistentry>
  204. <varlistentry id="udevinfo">
  205. <term><command>udevinfo</command></term>
  206. <listitem>
  207. <para>Allows users to query the Udev database for
  208. information on any device currently present on the system; it also
  209. provides a way to query any device in the <systemitem
  210. class="filesystem">sysfs</systemitem> tree to help create udev
  211. rules</para>
  212. <indexterm zone="ch-system-udev udevinfo">
  213. <primary sortas="b-udevinfo">udevinfo</primary>
  214. </indexterm>
  215. </listitem>
  216. </varlistentry>
  217. <varlistentry id="udevmonitor">
  218. <term><command>udevmonitor</command></term>
  219. <listitem>
  220. <para>Prints the event received from the kernel and the environment
  221. which Udev sends out after rule processing</para>
  222. <indexterm zone="ch-system-udev udevmonitor">
  223. <primary sortas="b-udevmonitor">udevmonitor</primary>
  224. </indexterm>
  225. </listitem>
  226. </varlistentry>
  227. <varlistentry id="udevsettle">
  228. <term><command>udevsettle</command></term>
  229. <listitem>
  230. <para>Watches the Udev event queue and exits if all current uevents
  231. have been handled</para>
  232. <indexterm zone="ch-system-udev udevsettle">
  233. <primary sortas="b-udevsettle">udevsettle</primary>
  234. </indexterm>
  235. </listitem>
  236. </varlistentry>
  237. <varlistentry id="udevtest">
  238. <term><command>udevtest</command></term>
  239. <listitem>
  240. <para>Simulates a uevent for the given device, and prints out the
  241. name of the node the real <command>udevd</command> would have created,
  242. or the name of the renamed network interface</para>
  243. <indexterm zone="ch-system-udev udevtest">
  244. <primary sortas="b-udevtest">udevtest</primary>
  245. </indexterm>
  246. </listitem>
  247. </varlistentry>
  248. <varlistentry id="udevtrigger">
  249. <term><command>udevtrigger</command></term>
  250. <listitem>
  251. <para>Triggers kernel device uevents to be replayed</para>
  252. <indexterm zone="ch-system-udev udevtrigger">
  253. <primary sortas="b-udevtrigger">udevtrigger</primary>
  254. </indexterm>
  255. </listitem>
  256. </varlistentry>
  257. <varlistentry id="usb_id">
  258. <term><command>usb_id</command></term>
  259. <listitem>
  260. <para>Provides Udev with information about USB
  261. devices</para>
  262. <indexterm zone="ch-system-udev usb_id">
  263. <primary sortas="b-usb_id">usb_id</primary>
  264. </indexterm>
  265. </listitem>
  266. </varlistentry>
  267. <varlistentry id="vol_id">
  268. <term><command>vol_id</command></term>
  269. <listitem>
  270. <para>Provides Udev with the label and uuid of a
  271. filesystem</para>
  272. <indexterm zone="ch-system-udev vol_id">
  273. <primary sortas="b-vol_id">vol_id</primary>
  274. </indexterm>
  275. </listitem>
  276. </varlistentry>
  277. <varlistentry id="write_cd_rules">
  278. <term><command>write_cd_rules</command></term>
  279. <listitem>
  280. <para>A script which generates Udev rules to provide stable names for
  281. optical drives (see also <xref linkend="ch-scripts-symlinks"/>)</para>
  282. <indexterm zone="ch-system-udev write_cd_rules">
  283. <primary sortas="b-write_cd_rules">write_cd_rules</primary>
  284. </indexterm>
  285. </listitem>
  286. </varlistentry>
  287. <varlistentry id="write_net_rules">
  288. <term><command>write_net_rules</command></term>
  289. <listitem>
  290. <para>A script which generates rules to provide stable names for
  291. network interfaces (see also <xref linkend="ch-scripts-network"/>)
  292. </para>
  293. <indexterm zone="ch-system-udev write_net_rules">
  294. <primary sortas="b-write_net_rules">write_net_rules</primary>
  295. </indexterm>
  296. </listitem>
  297. </varlistentry>
  298. <varlistentry id="libvolume_id">
  299. <term><command>libvolume_id</command></term>
  300. <listitem>
  301. <para></para>
  302. <indexterm zone="ch-system-udev libvolume_id">
  303. <primary sortas="c-libvolume_id">libvolume_id</primary>
  304. </indexterm>
  305. </listitem>
  306. </varlistentry>
  307. <varlistentry id="etc-udev">
  308. <term><filename class="directory">/etc/udev</filename></term>
  309. <listitem>
  310. <para>Contains Udev configuration files,
  311. device permissions, and rules for device naming</para>
  312. <indexterm zone="ch-system-udev etc-udev">
  313. <primary sortas="e-/etc/udev">/etc/udev</primary>
  314. </indexterm>
  315. </listitem>
  316. </varlistentry>
  317. </variablelist>
  318. </sect2>
  319. </sect1>