udev.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.4/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. <title>Udev-&udev-version;</title>
  10. <indexterm zone="ch-system-udev">
  11. <primary sortas="a-Udev">Udev</primary>
  12. </indexterm>
  13. <sect2 role="package">
  14. <title/>
  15. <para>The Udev package contains programs for dynamic creation of device
  16. nodes.</para>
  17. <segmentedlist>
  18. <segtitle>&buildtime;</segtitle>
  19. <segtitle>&diskspace;</segtitle>
  20. <seglistitem>
  21. <seg>&udev-ch6-sbu;</seg>
  22. <seg>&udev-ch6-du;</seg>
  23. </seglistitem>
  24. </segmentedlist>
  25. </sect2>
  26. <sect2 role="installation">
  27. <title>Installation of Udev</title>
  28. <para>The udev-config tarball contains LFS-specific files used to configure
  29. Udev. Unpack it into the Udev source directory:</para>
  30. <screen><userinput>tar -xvf ../&udev-config;.tar.bz2</userinput></screen>
  31. <para>Create some devices and directories that Udev cannot handle due to
  32. them being required very early in the boot process:</para>
  33. <screen><userinput>install -dv /lib/{firmware,udev/devices/{pts,shm}}
  34. mknod -m0666 /lib/udev/devices/null c 1 3
  35. ln -sv /proc/self/fd /lib/udev/devices/fd
  36. ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
  37. ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
  38. ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
  39. ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
  40. <para>Compile the package:</para>
  41. <screen><userinput>make EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
  42. extras/firmware extras/floppy extras/path_id extras/rule_generator \
  43. extras/scsi_id extras/usb_id extras/volume_id"</userinput></screen>
  44. <variablelist>
  45. <title>The meaning of the make option:</title>
  46. <varlistentry>
  47. <term><parameter>EXTRAS=...</parameter></term>
  48. <listitem>
  49. <para>This builds several helper binaries that can aid in writing custom
  50. Udev rules.</para>
  51. </listitem>
  52. </varlistentry>
  53. </variablelist>
  54. <para>To test the results, issue:
  55. <userinput>make test</userinput>.</para>
  56. <para>Note that the Udev testsuite will produce numerous messages in
  57. the host system's logs. These are harmless and can be ignored.</para>
  58. <para>Install the package:</para>
  59. <screen><userinput>make DESTDIR=/ \
  60. EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
  61. extras/firmware extras/floppy extras/path_id extras/rule_generator \
  62. extras/scsi_id extras/usb_id extras/volume_id" 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>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>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>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>make install-extra-doc</userinput></screen>
  87. <para>Install the documentation that explains how to create custom Udev
  88. rules:</para>
  89. <screen><userinput>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 directory</segtitle>
  98. <seglistitem>
  99. <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware_helper,
  100. path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle,
  101. udevtest, udevtrigger, usb_id, vol_id, and write_cd_aliases</seg>
  102. <seg>/etc/udev</seg>
  103. </seglistitem>
  104. </segmentedlist>
  105. <variablelist>
  106. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  107. <?dbfo list-presentation="list"?>
  108. <?dbhtml list-presentation="table"?>
  109. <varlistentry id="ata_id">
  110. <term><command>ata_id</command></term>
  111. <listitem>
  112. <para>Provides Udev with a unique string and
  113. additional information (uuid, label) for an ATA drive</para>
  114. <indexterm zone="ch-system-udev ata_id">
  115. <primary sortas="b-ata_id">ata_id</primary>
  116. </indexterm>
  117. </listitem>
  118. </varlistentry>
  119. <varlistentry id="cdrom_id">
  120. <term><command>cdrom_id</command></term>
  121. <listitem>
  122. <para>Provides Udev with the capabilities of a
  123. CD-ROM or DVD-ROM drive</para>
  124. <indexterm zone="ch-system-udev cdrom_id">
  125. <primary sortas="b-cdrom_id">cdrom_id</primary>
  126. </indexterm>
  127. </listitem>
  128. </varlistentry>
  129. <varlistentry id="create_floppy_devices">
  130. <term><command>create_floppy_devices</command></term>
  131. <listitem>
  132. <para>Creates all possible floppy devices based on the CMOS type</para>
  133. <indexterm zone="ch-system-udev create_floppy_devices">
  134. <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
  135. </indexterm>
  136. </listitem>
  137. </varlistentry>
  138. <varlistentry id="edd_id">
  139. <term><command>edd_id</command></term>
  140. <listitem>
  141. <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
  142. <indexterm zone="ch-system-udev edd_id">
  143. <primary sortas="b-edd_id">edd_id</primary>
  144. </indexterm>
  145. </listitem>
  146. </varlistentry>
  147. <varlistentry id="firmware_helper">
  148. <term><command>firmware_helper</command></term>
  149. <listitem>
  150. <para>Uploads firmware to devices</para>
  151. <indexterm zone="ch-system-udev firmware_helper">
  152. <primary sortas="b-firmware_helper">firmware_helper</primary>
  153. </indexterm>
  154. </listitem>
  155. </varlistentry>
  156. <varlistentry id="path_id">
  157. <term><command>path_id</command></term>
  158. <listitem>
  159. <para>Provide the shortest possible unique hardware path to a
  160. device</para>
  161. <indexterm zone="ch-system-udev path_id">
  162. <primary sortas="b-path_id">path_id</primary>
  163. </indexterm>
  164. </listitem>
  165. </varlistentry>
  166. <varlistentry id="scsi_id">
  167. <term><command>scsi_id</command></term>
  168. <listitem>
  169. <para>Provides Udev with a unique SCSI identifier
  170. based on the data returned from sending a SCSI INQUIRY command to
  171. the specified device</para>
  172. <indexterm zone="ch-system-udev scsi_id">
  173. <primary sortas="b-scsi_id">scsi_id</primary>
  174. </indexterm>
  175. </listitem>
  176. </varlistentry>
  177. <varlistentry id="udevcontrol">
  178. <term><command>udevcontrol</command></term>
  179. <listitem>
  180. <para>Configures a number of options for the running
  181. <command>udevd</command> daemon, such as the log level.</para>
  182. <indexterm zone="ch-system-udev udevcontrol">
  183. <primary sortas="b-udevcontrol">udevcontrol</primary>
  184. </indexterm>
  185. </listitem>
  186. </varlistentry>
  187. <varlistentry id="udevd">
  188. <term><command>udevd</command></term>
  189. <listitem>
  190. <para>A daemon that listens for uevents on the netlink socket,
  191. creates devices and runs the configured external programs in
  192. response to these uevents</para>
  193. <indexterm zone="ch-system-udev udevd">
  194. <primary sortas="b-udevd">udevd</primary>
  195. </indexterm>
  196. </listitem>
  197. </varlistentry>
  198. <varlistentry id="udevinfo">
  199. <term><command>udevinfo</command></term>
  200. <listitem>
  201. <para>Allows users to query the Udev database for
  202. information on any device currently present on the system; it also
  203. provides a way to query any device in the <systemitem
  204. class="filesystem">sysfs</systemitem> tree to help create udev
  205. rules</para>
  206. <indexterm zone="ch-system-udev udevinfo">
  207. <primary sortas="b-udevinfo">udevinfo</primary>
  208. </indexterm>
  209. </listitem>
  210. </varlistentry>
  211. <varlistentry id="udevmonitor">
  212. <term><command>udevmonitor</command></term>
  213. <listitem>
  214. <para>Prints the event received from the kernel and the environment
  215. which Udev sends out after rule processing</para>
  216. <indexterm zone="ch-system-udev udevmonitor">
  217. <primary sortas="b-udevmonitor">udevmonitor</primary>
  218. </indexterm>
  219. </listitem>
  220. </varlistentry>
  221. <varlistentry id="udevsettle">
  222. <term><command>udevsettle</command></term>
  223. <listitem>
  224. <para>Watches the Udev event queue and exits if all current uevents
  225. have been handled</para>
  226. <indexterm zone="ch-system-udev udevsettle">
  227. <primary sortas="b-udevsettle">udevsettle</primary>
  228. </indexterm>
  229. </listitem>
  230. </varlistentry>
  231. <varlistentry id="udevtest">
  232. <term><command>udevtest</command></term>
  233. <listitem>
  234. <para>Simulates a uevent for the given device, and prints out the
  235. name of the node the real <command>udevd</command> would have created,
  236. or the name of the renamed network interface</para>
  237. <indexterm zone="ch-system-udev udevtest">
  238. <primary sortas="b-udevtest">udevtest</primary>
  239. </indexterm>
  240. </listitem>
  241. </varlistentry>
  242. <varlistentry id="udevtrigger">
  243. <term><command>udevtrigger</command></term>
  244. <listitem>
  245. <para>Triggers kernel device uevents to be replayed</para>
  246. <indexterm zone="ch-system-udev udevtrigger">
  247. <primary sortas="b-udevtrigger">udevtrigger</primary>
  248. </indexterm>
  249. </listitem>
  250. </varlistentry>
  251. <varlistentry id="usb_id">
  252. <term><command>usb_id</command></term>
  253. <listitem>
  254. <para>Provides Udev with information about USB
  255. devices</para>
  256. <indexterm zone="ch-system-udev usb_id">
  257. <primary sortas="b-usb_id">usb_id</primary>
  258. </indexterm>
  259. </listitem>
  260. </varlistentry>
  261. <varlistentry id="vol_id">
  262. <term><command>vol_id</command></term>
  263. <listitem>
  264. <para>Provides Udev with the label and uuid of a
  265. filesystem</para>
  266. <indexterm zone="ch-system-udev vol_id">
  267. <primary sortas="b-vol_id">vol_id</primary>
  268. </indexterm>
  269. </listitem>
  270. </varlistentry>
  271. <varlistentry id="etc-udev">
  272. <term><filename class="directory">/etc/udev</filename></term>
  273. <listitem>
  274. <para>Contains Udev configuation files,
  275. device permissions, and rules for device naming</para>
  276. <indexterm zone="ch-system-udev etc-udev">
  277. <primary sortas="e-/etc/udev">/etc/udev</primary>
  278. </indexterm>
  279. </listitem>
  280. </varlistentry>
  281. </variablelist>
  282. </sect2>
  283. </sect1>