udev.xml 13 KB

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