udev.xml 11 KB

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