udev.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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>Prepare the package for compilation:</para>
  47. <screen><userinput remap="configure">./configure --prefix=/usr \
  48. --exec-prefix= \
  49. --sysconfdir=/etc</userinput></screen>
  50. <para>Compile the package:</para>
  51. <screen><userinput remap="make">make</userinput></screen>
  52. <para>This package does not come with a test suite.</para>
  53. <para>Install the package:</para>
  54. <screen><userinput remap="install">make install</userinput></screen>
  55. <para>Udev has to be configured in order to work properly, as its default
  56. configuration does not cover all devices. First install two extra rules
  57. files from Udev to help support device-mapper and RAID setups:</para>
  58. <screen><userinput remap="install">install -m644 -v rules/packages/64-*.rules \
  59. /lib/udev/rules.d/</userinput></screen>
  60. <para>Now install a file to create symlinks for certain hand-held devices:</para>
  61. <screen><userinput remap="install">install -m644 -v rules/packages/40-pilot-links.rules \
  62. /lib/udev/rules.d/</userinput></screen>
  63. <!-- There are more files available in the packages/ directory, if we want
  64. to consider using them. Most are probably irrelevant to LFS though.
  65. "alsa" isn't, but we already have those rules, using a better set of
  66. matches. Most of the files in packages/ are for other architectures. -->
  67. <para>Now install the LFS-specific custom rules files:</para>
  68. <screen><userinput remap="install">cd &udev-config;
  69. make install</userinput></screen>
  70. <para>Install the documentation that explains the LFS-specific rules
  71. files:</para>
  72. <screen><userinput remap="install">make install-doc</userinput></screen>
  73. <para>Install the documentation that explains the commonly-used rules
  74. files provided by Udev:</para>
  75. <screen><userinput remap="install">make install-extra-doc</userinput></screen>
  76. <para>Install the documentation that explains how to create custom Udev
  77. rules:</para>
  78. <screen><userinput remap="install">cd ..
  79. install -m644 -v -D 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 libraries</segtitle>
  87. <segtitle>Installed directory</segtitle>
  88. <seglistitem>
  89. <seg>ata_id, cdrom_id, collect, create_floppy_devices, edd_id,
  90. firmware.sh, fstab_import, path_id, scsi_id, udevadm, udevd,
  91. usb_id, vol_id, write_cd_rules, and write_net_rules</seg>
  92. <seg>libudev and libvolume_id</seg>
  93. <seg>/etc/udev</seg>
  94. </seglistitem>
  95. </segmentedlist>
  96. <variablelist>
  97. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  98. <?dbfo list-presentation="list"?>
  99. <?dbhtml list-presentation="table"?>
  100. <varlistentry id="ata_id">
  101. <term><command>ata_id</command></term>
  102. <listitem>
  103. <para>Provides Udev with a unique string and
  104. additional information (uuid, label) for an ATA drive</para>
  105. <indexterm zone="ch-system-udev ata_id">
  106. <primary sortas="b-ata_id">ata_id</primary>
  107. </indexterm>
  108. </listitem>
  109. </varlistentry>
  110. <varlistentry id="cdrom_id">
  111. <term><command>cdrom_id</command></term>
  112. <listitem>
  113. <para>Provides Udev with the capabilities of a
  114. CD-ROM or DVD-ROM drive</para>
  115. <indexterm zone="ch-system-udev cdrom_id">
  116. <primary sortas="b-cdrom_id">cdrom_id</primary>
  117. </indexterm>
  118. </listitem>
  119. </varlistentry>
  120. <varlistentry id="collect">
  121. <term><command>collect</command></term>
  122. <listitem>
  123. <para>Given an ID for the current uevent and a list of
  124. IDs (for all target uevents), registers the current ID
  125. and indicates whether all target IDs have been registered</para>
  126. <indexterm zone="ch-system-udev collect">
  127. <primary sortas="b-collect">collect</primary>
  128. </indexterm>
  129. </listitem>
  130. </varlistentry>
  131. <varlistentry id="create_floppy_devices">
  132. <term><command>create_floppy_devices</command></term>
  133. <listitem>
  134. <para>Creates all possible floppy devices based on the CMOS type</para>
  135. <indexterm zone="ch-system-udev create_floppy_devices">
  136. <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
  137. </indexterm>
  138. </listitem>
  139. </varlistentry>
  140. <varlistentry id="edd_id">
  141. <term><command>edd_id</command></term>
  142. <listitem>
  143. <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
  144. <indexterm zone="ch-system-udev edd_id">
  145. <primary sortas="b-edd_id">edd_id</primary>
  146. </indexterm>
  147. </listitem>
  148. </varlistentry>
  149. <varlistentry id="firmware.sh">
  150. <term><command>firmware.sh</command></term>
  151. <listitem>
  152. <para>Uploads firmware to devices</para>
  153. <indexterm zone="ch-system-udev firmware.sh">
  154. <primary sortas="b-firmware.sh">firmware.sh</primary>
  155. </indexterm>
  156. </listitem>
  157. </varlistentry>
  158. <varlistentry id="fstab_import">
  159. <term><command>fstab_import</command></term>
  160. <listitem>
  161. <para>Finds an entry in <filename>/etc/fstab</filename> that
  162. matches the current device, and provides its information to
  163. Udev</para>
  164. <indexterm zone="ch-system-udev fstab_import">
  165. <primary sortas="b-fstab_import">fstab_import</primary>
  166. </indexterm>
  167. </listitem>
  168. </varlistentry>
  169. <varlistentry id="path_id">
  170. <term><command>path_id</command></term>
  171. <listitem>
  172. <para>Provides the shortest possible unique hardware path to a
  173. device</para>
  174. <indexterm zone="ch-system-udev path_id">
  175. <primary sortas="b-path_id">path_id</primary>
  176. </indexterm>
  177. </listitem>
  178. </varlistentry>
  179. <varlistentry id="scsi_id">
  180. <term><command>scsi_id</command></term>
  181. <listitem>
  182. <para>Provides Udev with a unique SCSI identifier
  183. based on the data returned from sending a SCSI INQUIRY command to
  184. the specified device</para>
  185. <indexterm zone="ch-system-udev scsi_id">
  186. <primary sortas="b-scsi_id">scsi_id</primary>
  187. </indexterm>
  188. </listitem>
  189. </varlistentry>
  190. <varlistentry id="udevadm">
  191. <term><command>udevadm</command></term>
  192. <listitem>
  193. <para>Generic udev administration tool: controls the udevd daemon,
  194. provides info from the Udev database, monitors uevents, waits for
  195. uevents to finish, tests Udev configuration, and triggers uevents
  196. for a given device</para>
  197. <indexterm zone="ch-system-udev udevadm">
  198. <primary sortas="b-udevadm">udevadm</primary>
  199. </indexterm>
  200. </listitem>
  201. </varlistentry>
  202. <varlistentry id="udevd">
  203. <term><command>udevd</command></term>
  204. <listitem>
  205. <para>A daemon that listens for uevents on the netlink socket,
  206. creates devices and runs the configured external programs in
  207. response to these uevents</para>
  208. <indexterm zone="ch-system-udev udevd">
  209. <primary sortas="b-udevd">udevd</primary>
  210. </indexterm>
  211. </listitem>
  212. </varlistentry>
  213. <varlistentry id="usb_id">
  214. <term><command>usb_id</command></term>
  215. <listitem>
  216. <para>Provides Udev with information about USB
  217. devices</para>
  218. <indexterm zone="ch-system-udev usb_id">
  219. <primary sortas="b-usb_id">usb_id</primary>
  220. </indexterm>
  221. </listitem>
  222. </varlistentry>
  223. <varlistentry id="vol_id">
  224. <term><command>vol_id</command></term>
  225. <listitem>
  226. <para>Provides Udev with the label and uuid of a
  227. filesystem</para>
  228. <indexterm zone="ch-system-udev vol_id">
  229. <primary sortas="b-vol_id">vol_id</primary>
  230. </indexterm>
  231. </listitem>
  232. </varlistentry>
  233. <varlistentry id="write_cd_rules">
  234. <term><command>write_cd_rules</command></term>
  235. <listitem>
  236. <para>A script which generates Udev rules to provide stable names for
  237. optical drives (see also <xref linkend="ch-scripts-symlinks"/>)</para>
  238. <indexterm zone="ch-system-udev write_cd_rules">
  239. <primary sortas="b-write_cd_rules">write_cd_rules</primary>
  240. </indexterm>
  241. </listitem>
  242. </varlistentry>
  243. <varlistentry id="write_net_rules">
  244. <term><command>write_net_rules</command></term>
  245. <listitem>
  246. <para>A script which generates rules to provide stable names for
  247. network interfaces (see also <xref linkend="ch-scripts-network"/>)
  248. </para>
  249. <indexterm zone="ch-system-udev write_net_rules">
  250. <primary sortas="b-write_net_rules">write_net_rules</primary>
  251. </indexterm>
  252. </listitem>
  253. </varlistentry>
  254. <varlistentry id="libudev">
  255. <term><command>libudev</command></term>
  256. <listitem>
  257. <para>A library interface to udev device information</para>
  258. <indexterm zone="ch-system-udev libudev">
  259. <primary sortas="c-libudev">libudev</primary>
  260. </indexterm>
  261. </listitem>
  262. </varlistentry>
  263. <varlistentry id="libvolume_id">
  264. <term><command>libvolume_id</command></term>
  265. <listitem>
  266. <para>A library interface to read volume labels and uuids</para>
  267. <indexterm zone="ch-system-udev libvolume_id">
  268. <primary sortas="c-libvolume_id">libvolume_id</primary>
  269. </indexterm>
  270. </listitem>
  271. </varlistentry>
  272. <varlistentry id="etc-udev">
  273. <term><filename class="directory">/etc/udev</filename></term>
  274. <listitem>
  275. <para>Contains Udev configuration files,
  276. device permissions, and rules for device naming</para>
  277. <indexterm zone="ch-system-udev etc-udev">
  278. <primary sortas="e-/etc/udev">/etc/udev</primary>
  279. </indexterm>
  280. </listitem>
  281. </varlistentry>
  282. </variablelist>
  283. </sect2>
  284. </sect1>