udev.xml 12 KB

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