hotplug.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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-hotplug" role="wrap">
  8. <?dbhtml filename="hotplug.html"?>
  9. <title>Hotplug-&hotplug-version;</title>
  10. <indexterm zone="ch-system-hotplug">
  11. <primary sortas="a-Hotplug">Hotplug</primary>
  12. </indexterm>
  13. <sect2 role="package">
  14. <title/>
  15. <para>The Hotplug package contains scripts that react upon hotplug events
  16. generated by the kernel. Such events correspond to every change in the kernel
  17. state visible in the <systemitem class="filesystem">sysfs</systemitem>
  18. filesystem, e.g., the addition and removal of hardware. This package also
  19. detects existing hardware during boot and inserts the relevant modules into the
  20. running kernel.</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>0.01 SBU</seg>
  26. <seg>460 KB</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. <segmentedlist>
  30. <segtitle>&dependencies;</segtitle>
  31. <seglistitem>
  32. <seg>Bash, Coreutils, Findutils, Gawk, and Make</seg>
  33. </seglistitem>
  34. </segmentedlist>
  35. </sect2>
  36. <sect2 role="installation">
  37. <title>Installation of Hotplug</title>
  38. <para>This package does not come with a test suite.</para>
  39. <para>Install the Hotplug package:</para>
  40. <screen><userinput>make install</userinput></screen>
  41. <para>Copy a file that the <quote>install</quote> target omits.</para>
  42. <screen><userinput>cp -v etc/hotplug/pnp.distmap /etc/hotplug</userinput></screen>
  43. <para>Remove the init script that Hotplug installs since we are going to be
  44. using the script included in the LFS-Bootscripts package:</para>
  45. <screen><userinput>rm -rfv /etc/init.d</userinput></screen>
  46. <para>Network device hotplugging is not yet supported by the LFS-Bootscripts
  47. package. For that reason, remove the network hotplug agent:</para>
  48. <screen><userinput>rm -fv /etc/hotplug/net.agent</userinput></screen>
  49. <para>Create a directory for storing firmware that can be loaded by
  50. <command>hotplug</command>:</para>
  51. <screen><userinput>mkdir -v /lib/firmware</userinput></screen>
  52. </sect2>
  53. <sect2 id="contents-hotplug" role="content">
  54. <title>Contents of Hotplug</title>
  55. <segmentedlist>
  56. <segtitle>Installed program</segtitle>
  57. <segtitle>Installed scripts</segtitle>
  58. <segtitle>Installed files</segtitle>
  59. <seglistitem>
  60. <seg>hotplug</seg>
  61. <seg>/etc/hotplug/*.rc, /etc/hotplug/*.agent</seg>
  62. <seg>/etc/hotplug/hotplug.functions, /etc/hotplug/blacklist,
  63. /etc/hotplug/{pci,usb}, /etc/hotplug/usb.usermap, /etc/hotplug.d,
  64. and /var/log/hotplug/events</seg>
  65. </seglistitem>
  66. </segmentedlist>
  67. <variablelist>
  68. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  69. <?dbfo list-presentation="list"?>
  70. <?dbhtml list-presentation="table"?>
  71. <varlistentry id="hotplug">
  72. <term><command>hotplug</command></term>
  73. <listitem>
  74. <para>This script is called by default by the Linux kernel when
  75. something changes in its internal state (e.g., a new device is
  76. added or an existing device is removed)</para>
  77. <indexterm zone="ch-system-hotplug hotplug">
  78. <primary sortas="b-hotplug">hotplug</primary>
  79. </indexterm>
  80. </listitem>
  81. </varlistentry>
  82. <varlistentry id="hotplug-rc">
  83. <term><command>/etc/hotplug/*.rc</command></term>
  84. <listitem>
  85. <para>These scripts are used for cold plugging, i.e., detecting and
  86. acting upon hardware already present during system startup. They are
  87. called by the <filename>hotplug</filename> initscript included in
  88. the LFS-Bootscripts package. The <command>*.rc</command> scripts try
  89. to recover hotplug events that were lost during system boot because,
  90. for example, the root filesystem was not mounted by the kernel</para>
  91. <indexterm zone="ch-system-hotplug hotplug-rc">
  92. <primary sortas="d-/etc/hotplug/*.rc">/etc/hotplug/*.rc</primary>
  93. </indexterm>
  94. </listitem>
  95. </varlistentry>
  96. <varlistentry id="hotplug-agent">
  97. <term><command>/etc/hotplug/*.agent</command></term>
  98. <listitem>
  99. <para>These scripts are called by <command>hotplug</command> in response
  100. to different types of hotplug events generated by the kernel. Their
  101. action is to insert corresponding kernel modules and call any
  102. user-provided scripts</para>
  103. <indexterm zone="ch-system-hotplug hotplug-agent">
  104. <primary sortas="d-/etc/hotplug/*.agent">/etc/hotplug/*.agent</primary>
  105. </indexterm>
  106. </listitem>
  107. </varlistentry>
  108. <varlistentry id="hotplug-blacklist">
  109. <term><filename>/etc/hotplug/blacklist</filename></term>
  110. <listitem>
  111. <para>This file contains the list of modules that should never be
  112. inserted into the kernel by the Hotplug scripts</para>
  113. <indexterm zone="ch-system-hotplug hotplug-blacklist">
  114. <primary sortas="e-/etc/hotplug/blacklist">/etc/hotplug/blacklist</primary>
  115. </indexterm>
  116. </listitem>
  117. </varlistentry>
  118. <varlistentry id="hotplug-functions">
  119. <term><filename>/etc/hotplug/hotplug.functions</filename></term>
  120. <listitem>
  121. <para>This file contains common functions used by other scripts in the
  122. Hotplug package</para>
  123. <indexterm zone="ch-system-hotplug hotplug-functions">
  124. <primary sortas="e-/etc/hotplug/hotplug.functions">/etc/hotplug/hotplug.functions</primary>
  125. </indexterm>
  126. </listitem>
  127. </varlistentry>
  128. <varlistentry id="hotplug-subdirs">
  129. <term><filename class="directory">/etc/hotplug/{pci,usb}</filename></term>
  130. <listitem>
  131. <para>These directories contain user-written handlers for hotplug
  132. events</para>
  133. <indexterm zone="ch-system-hotplug hotplug-subdirs">
  134. <primary sortas="e-/etc/hotplug/{pci,usb}">/etc/hotplug/{pci,usb}</primary>
  135. </indexterm>
  136. </listitem>
  137. </varlistentry>
  138. <varlistentry id="hotplug-usb.usermap">
  139. <term><filename>/etc/hotplug/usb.usermap</filename></term>
  140. <listitem>
  141. <para>This file contains rules that determine which user-defined handlers to
  142. call for each USB device, based on its vendor ID and other
  143. attributes</para>
  144. <indexterm zone="ch-system-hotplug hotplug-usb.usermap">
  145. <primary sortas="e-/etc/hotplug/usb.usermap">/etc/hotplug/usb.usermap</primary>
  146. </indexterm>
  147. </listitem>
  148. </varlistentry>
  149. <varlistentry id="hotplug-hotplug.d">
  150. <term><filename class="directory">/etc/hotplug.d</filename></term>
  151. <listitem>
  152. <para>This directory contains programs (or symlinks to them) that are
  153. interested in receiving hotplug events. For example, Udev puts its
  154. symlink here during installation</para>
  155. <indexterm zone="ch-system-hotplug hotplug-hotplug.d">
  156. <primary sortas="e-/etc/hotplug.d">/etc/hotplug.d</primary>
  157. </indexterm>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry id="hotplug-firmware">
  161. <term><filename class="directory">/lib/firmware</filename></term>
  162. <listitem>
  163. <para>This directory contains the firmware for devices that need to
  164. have their firmware loaded before use</para>
  165. <indexterm zone="ch-system-hotplug hotplug-firmware">
  166. <primary sortas="e-/lib/firmware">/lib/firmware</primary>
  167. </indexterm>
  168. </listitem>
  169. </varlistentry>
  170. <varlistentry id="hotplug-events">
  171. <term><filename>/var/log/hotplug/events</filename></term>
  172. <listitem>
  173. <para>This file contains all the events that <command>hotplug</command>
  174. has called since bootup</para>
  175. <indexterm zone="ch-system-hotplug hotplug-events">
  176. <primary sortas="e-/var/log/hotplug/events">/var/log/hotplug/events</primary>
  177. </indexterm>
  178. </listitem>
  179. </varlistentry>
  180. </variablelist>
  181. </sect2>
  182. </sect1>