udev.xml 11 KB

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