udev.xml 13 KB

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