udev.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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. <sect1info condition="script">
  10. <productname>udev</productname>
  11. <productnumber>&udev-version;</productnumber>
  12. <address>&udev-url;</address>
  13. </sect1info>
  14. <title>Udev-&udev-version;</title>
  15. <indexterm zone="ch-system-udev">
  16. <primary sortas="a-Udev">Udev</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>The Udev package contains programs for dynamic creation of device
  21. nodes.</para>
  22. <segmentedlist>
  23. <segtitle>&buildtime;</segtitle>
  24. <segtitle>&diskspace;</segtitle>
  25. <seglistitem>
  26. <seg>&udev-ch6-sbu;</seg>
  27. <seg>&udev-ch6-du;</seg>
  28. </seglistitem>
  29. </segmentedlist>
  30. </sect2>
  31. <sect2 role="installation">
  32. <title>Installation of Udev</title>
  33. <para>The udev-config tarball contains LFS-specific files used to configure
  34. Udev. Unpack it into the Udev source directory:</para>
  35. <screen><userinput remap="pre">tar -xvf ../&udev-config;.tar.bz2</userinput></screen>
  36. <para>Create some devices and directories that Udev cannot handle due to
  37. them being required very early in the boot process, or by Udev itself:</para>
  38. <screen><userinput remap="install">install -dv /lib/{firmware,udev/devices/{pts,shm}}
  39. mknod -m0666 /lib/udev/devices/null c 1 3
  40. mknod -m0600 /lib/udev/devices/kmsg c 1 11
  41. ln -sv /proc/self/fd /lib/udev/devices/fd
  42. ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
  43. ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
  44. ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
  45. ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
  46. <para>Compile the package:</para>
  47. <screen><userinput remap="make">make EXTRAS="`echo extras/*/`"</userinput></screen>
  48. <variablelist>
  49. <title>The meaning of the make option:</title>
  50. <varlistentry>
  51. <term><parameter>EXTRAS=...</parameter></term>
  52. <listitem>
  53. <para>This builds the helper binaries that can aid in writing custom
  54. Udev rules.</para>
  55. </listitem>
  56. </varlistentry>
  57. </variablelist>
  58. <para>To test the results, issue:</para>
  59. <screen><userinput remap="test">make test</userinput></screen>
  60. <para>Note that the Udev testsuite will produce numerous messages in
  61. the host system's logs. These are harmless and can be ignored.</para>
  62. <para>Install the package:</para>
  63. <screen><userinput remap="install">make DESTDIR=/ EXTRAS="`echo extras/*/`" install</userinput></screen>
  64. <variablelist>
  65. <title>The meaning of the make parameter:</title>
  66. <varlistentry>
  67. <term><parameter>DESTDIR=/</parameter></term>
  68. <listitem>
  69. <para>This prevents the Udev build process from killing any
  70. <command>udevd</command> processes that may be running on the
  71. host system.</para>
  72. </listitem>
  73. </varlistentry>
  74. </variablelist>
  75. <para>Udev has to be configured in order to work properly, as its default
  76. configuration does not cover all devices. First install a few extra rules
  77. files from Udev to help support device-mapper and RAID setups:</para>
  78. <screen><userinput remap="install">install -m644 -v etc/udev/packages/64-*.rules \
  79. /etc/udev/rules.d/</userinput></screen>
  80. <para>Now install a file to create symlinks for certain hand-held devices:</para>
  81. <screen><userinput remap="install">install -m644 -v etc/udev/packages/40-pilot-links.rules \
  82. /etc/udev/rules.d/40-pilot-links.rules</userinput></screen>
  83. <!-- There are more files available in the packages/ directory, if we want
  84. to consider using them. Most are probably irrelevant to LFS though.
  85. "alsa" isn't, but we already have those rules, using a better set of
  86. matches. Most of the files in packages/ are for other architectures. -->
  87. <para>Now install the LFS-specific custom rules files:</para>
  88. <screen><userinput remap="install">cd &udev-config;
  89. make install</userinput></screen>
  90. <para>Install the documentation that explains the LFS-specific rules
  91. files:</para>
  92. <screen><userinput remap="install">make install-doc</userinput></screen>
  93. <para>Install the documentation that explains the commonly-used rules
  94. files provided by Udev:</para>
  95. <screen><userinput remap="install">make install-extra-doc</userinput></screen>
  96. <para>Install the documentation that explains how to create custom Udev
  97. rules:</para>
  98. <screen><userinput remap="install">cd ..
  99. install -dv /usr/share/doc/udev-&udev-version;
  100. install -m644 -v docs/writing_udev_rules/index.html \
  101. /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
  102. </sect2>
  103. <sect2 id="contents-udev" role="content">
  104. <title>Contents of Udev</title>
  105. <segmentedlist>
  106. <segtitle>Installed programs</segtitle>
  107. <segtitle>Installed libraries</segtitle>
  108. <segtitle>Installed directory</segtitle>
  109. <seglistitem>
  110. <seg>ata_id, cdrom_id, collect, create_floppy_devices, edd_id,
  111. firmware.sh, fstab_import, path_id, scsi_id, udevadm, udevd,
  112. usb_id, vol_id, write_cd_rules, and write_net_rules</seg>
  113. <seg>libvolume_id</seg>
  114. <seg>/etc/udev</seg>
  115. </seglistitem>
  116. </segmentedlist>
  117. <variablelist>
  118. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  119. <?dbfo list-presentation="list"?>
  120. <?dbhtml list-presentation="table"?>
  121. <varlistentry id="ata_id">
  122. <term><command>ata_id</command></term>
  123. <listitem>
  124. <para>Provides Udev with a unique string and
  125. additional information (uuid, label) for an ATA drive</para>
  126. <indexterm zone="ch-system-udev ata_id">
  127. <primary sortas="b-ata_id">ata_id</primary>
  128. </indexterm>
  129. </listitem>
  130. </varlistentry>
  131. <varlistentry id="cdrom_id">
  132. <term><command>cdrom_id</command></term>
  133. <listitem>
  134. <para>Provides Udev with the capabilities of a
  135. CD-ROM or DVD-ROM drive</para>
  136. <indexterm zone="ch-system-udev cdrom_id">
  137. <primary sortas="b-cdrom_id">cdrom_id</primary>
  138. </indexterm>
  139. </listitem>
  140. </varlistentry>
  141. <varlistentry id="collect">
  142. <term><command>collect</command></term>
  143. <listitem>
  144. <para>Given an ID for the current uevent and a list of
  145. IDs (for all target uevents), registers the current ID
  146. and indicates whether all target IDs have been registered</para>
  147. <indexterm zone="ch-system-udev collect">
  148. <primary sortas="b-collect">collect</primary>
  149. </indexterm>
  150. </listitem>
  151. </varlistentry>
  152. <varlistentry id="create_floppy_devices">
  153. <term><command>create_floppy_devices</command></term>
  154. <listitem>
  155. <para>Creates all possible floppy devices based on the CMOS type</para>
  156. <indexterm zone="ch-system-udev create_floppy_devices">
  157. <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
  158. </indexterm>
  159. </listitem>
  160. </varlistentry>
  161. <varlistentry id="edd_id">
  162. <term><command>edd_id</command></term>
  163. <listitem>
  164. <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
  165. <indexterm zone="ch-system-udev edd_id">
  166. <primary sortas="b-edd_id">edd_id</primary>
  167. </indexterm>
  168. </listitem>
  169. </varlistentry>
  170. <varlistentry id="firmware.sh">
  171. <term><command>firmware.sh</command></term>
  172. <listitem>
  173. <para>Uploads firmware to devices</para>
  174. <indexterm zone="ch-system-udev firmware.sh">
  175. <primary sortas="b-firmware.sh">firmware.sh</primary>
  176. </indexterm>
  177. </listitem>
  178. </varlistentry>
  179. <varlistentry id="fstab_import">
  180. <term><command>fstab_import</command></term>
  181. <listitem>
  182. <para>Finds an entry in <filename>/etc/fstab</filename> that
  183. matches the current device, and provides its information to
  184. Udev</para>
  185. <indexterm zone="ch-system-udev fstab_import">
  186. <primary sortas="b-fstab_import">fstab_import</primary>
  187. </indexterm>
  188. </listitem>
  189. </varlistentry>
  190. <varlistentry id="path_id">
  191. <term><command>path_id</command></term>
  192. <listitem>
  193. <para>Provides the shortest possible unique hardware path to a
  194. device</para>
  195. <indexterm zone="ch-system-udev path_id">
  196. <primary sortas="b-path_id">path_id</primary>
  197. </indexterm>
  198. </listitem>
  199. </varlistentry>
  200. <varlistentry id="scsi_id">
  201. <term><command>scsi_id</command></term>
  202. <listitem>
  203. <para>Provides Udev with a unique SCSI identifier
  204. based on the data returned from sending a SCSI INQUIRY command to
  205. the specified device</para>
  206. <indexterm zone="ch-system-udev scsi_id">
  207. <primary sortas="b-scsi_id">scsi_id</primary>
  208. </indexterm>
  209. </listitem>
  210. </varlistentry>
  211. <varlistentry id="udevadm">
  212. <term><command>udevadm</command></term>
  213. <listitem>
  214. <para>Generic udev administration tool: controls the udevd daemon,
  215. provides info from the Udev database, monitors uevents, waits for
  216. uevents to finish, tests Udev configuration, and triggers uevents
  217. for a given device</para>
  218. <indexterm zone="ch-system-udev udevadm">
  219. <primary sortas="b-udevadm">udevadm</primary>
  220. </indexterm>
  221. </listitem>
  222. </varlistentry>
  223. <varlistentry id="udevd">
  224. <term><command>udevd</command></term>
  225. <listitem>
  226. <para>A daemon that listens for uevents on the netlink socket,
  227. creates devices and runs the configured external programs in
  228. response to these uevents</para>
  229. <indexterm zone="ch-system-udev udevd">
  230. <primary sortas="b-udevd">udevd</primary>
  231. </indexterm>
  232. </listitem>
  233. </varlistentry>
  234. <varlistentry id="usb_id">
  235. <term><command>usb_id</command></term>
  236. <listitem>
  237. <para>Provides Udev with information about USB
  238. devices</para>
  239. <indexterm zone="ch-system-udev usb_id">
  240. <primary sortas="b-usb_id">usb_id</primary>
  241. </indexterm>
  242. </listitem>
  243. </varlistentry>
  244. <varlistentry id="vol_id">
  245. <term><command>vol_id</command></term>
  246. <listitem>
  247. <para>Provides Udev with the label and uuid of a
  248. filesystem</para>
  249. <indexterm zone="ch-system-udev vol_id">
  250. <primary sortas="b-vol_id">vol_id</primary>
  251. </indexterm>
  252. </listitem>
  253. </varlistentry>
  254. <varlistentry id="write_cd_rules">
  255. <term><command>write_cd_rules</command></term>
  256. <listitem>
  257. <para>A script which generates Udev rules to provide stable names for
  258. optical drives (see also <xref linkend="ch-scripts-symlinks"/>)</para>
  259. <indexterm zone="ch-system-udev write_cd_rules">
  260. <primary sortas="b-write_cd_rules">write_cd_rules</primary>
  261. </indexterm>
  262. </listitem>
  263. </varlistentry>
  264. <varlistentry id="write_net_rules">
  265. <term><command>write_net_rules</command></term>
  266. <listitem>
  267. <para>A script which generates rules to provide stable names for
  268. network interfaces (see also <xref linkend="ch-scripts-network"/>)
  269. </para>
  270. <indexterm zone="ch-system-udev write_net_rules">
  271. <primary sortas="b-write_net_rules">write_net_rules</primary>
  272. </indexterm>
  273. </listitem>
  274. </varlistentry>
  275. <varlistentry id="libvolume_id">
  276. <term><command>libvolume_id</command></term>
  277. <listitem>
  278. <para></para>
  279. <indexterm zone="ch-system-udev libvolume_id">
  280. <primary sortas="c-libvolume_id">libvolume_id</primary>
  281. </indexterm>
  282. </listitem>
  283. </varlistentry>
  284. <varlistentry id="etc-udev">
  285. <term><filename class="directory">/etc/udev</filename></term>
  286. <listitem>
  287. <para>Contains Udev configuration files,
  288. device permissions, and rules for device naming</para>
  289. <indexterm zone="ch-system-udev etc-udev">
  290. <primary sortas="e-/etc/udev">/etc/udev</primary>
  291. </indexterm>
  292. </listitem>
  293. </varlistentry>
  294. </variablelist>
  295. </sect2>
  296. </sect1>