udev.xml 11 KB

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