hotplug.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-system-hotplug" role="wrap">
  7. <title>Hotplug-&hotplug-version;</title>
  8. <?dbhtml filename="hotplug.html"?>
  9. <indexterm zone="ch-system-hotplug"><primary sortas="a-Hotplug">Hotplug</primary></indexterm>
  10. <sect2 role="package"><title/>
  11. <para>The Hotplug package contains scripts that react upon various changes
  12. in the kernel state, in particular, addition and removal of hardware. This
  13. package also detects existing hardware during boot and inserts the relevant
  14. modules into the running kernel.
  15. </para>
  16. <segmentedlist>
  17. <segtitle>&buildtime;</segtitle>
  18. <segtitle>&diskspace;</segtitle>
  19. <seglistitem><seg>0.01 SBU</seg><seg>0.1 MB</seg></seglistitem>
  20. </segmentedlist>
  21. </sect2>
  22. <sect2 role="installation">
  23. <title>Installation of Hotplug</title>
  24. <para>
  25. By default, Hotplug does not output anything in its initscript and places it
  26. into
  27. <filename class="directory">/etc/init.d</filename>,
  28. whereas the place for initscripts in LFS is
  29. <filename class="directory">/etc/rc.d/init.d</filename>. Apply the patch
  30. that makes the output of hotplug initscript more verbose and places this
  31. initscript into the proper directory:
  32. </para>
  33. <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-cosmetic-2.patch
  34. </userinput></screen>
  35. <para>
  36. Apply the patch that avoids bogus dependencies of the hotplug initscript
  37. upon <application>which</application> and
  38. <application>usbutils</application> packages:
  39. </para>
  40. <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-bogus-deps-1.patch
  41. </userinput></screen>
  42. <para>
  43. USB coldplugging is somewhat broken in Hotplug by default. Fix this with the
  44. following patch:
  45. </para>
  46. <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-device-2.patch
  47. </userinput></screen>
  48. <para>
  49. At last, there is an optional patch that adds ISAPNP hardware detection
  50. capabilities to hotplug. It is not well tested. If you chose to apply it,
  51. run the following command:
  52. </para>
  53. <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-isapnp-2.patch
  54. </userinput></screen>
  55. <para>And finally install the hotplug package:</para>
  56. <screen><userinput>make install</userinput></screen>
  57. <para>Make a symbolic link that tells the lfs-bootscripts package to run the
  58. hotplug initscript after mounting and cleaning filesystems:</para>
  59. <screen><userinput>ln -sf ../init.d/hotplug /etc/rc.d/init.d/S55hotplug</userinput></screen>
  60. <para>
  61. If you have applied the ISAPNP patch, add some required entries to
  62. <filename>/etc/modprobe.conf</filename>:</para>
  63. <screen><userinput>cat &gt;&gt;/etc/modprobe.conf &lt;&lt;"EOF"</userinput>
  64. # Begin /etc/modprobe.conf entries for ISAPNP hardware detection script
  65. # by Marco d'Itri
  66. alias pnp:dPNP0511 irtty-sir
  67. alias pnp:dPNP0700 floppy
  68. alias pnp:dPNP0800 pcspkr
  69. alias pnp:dPNP0B00 rtc
  70. alias pnp:dPNP0303 atkbd
  71. alias pnp:dPNP0F13 psmouse
  72. alias pnp:dPNPB02F analog
  73. # End /etc/modprobe.conf entries for ISAPNP hardware detection script
  74. <userinput>EOF</userinput></screen>
  75. <para>These entries may become unneded for newer versions of Linux kernel,
  76. since Marco d'Itri will try to convince developers to put them into the
  77. corresponding modules themselves.</para>
  78. </sect2>
  79. <sect2 id="contents-hotplug" role="content"><title>Contents of Hotplug</title>
  80. <para></para>
  81. </sect2>
  82. <variablelist>
  83. <varlistentry>
  84. <term id="hotplug"><command>/sbin/hotplug</command></term>
  85. <listitem>
  86. <indexterm zone="ch-system-hotplug hotplug"><primary
  87. sortas="b-hotplug">hotplug</primary></indexterm>
  88. <para>This script is called by default by Linux kernel when something
  89. changes in its internal state (e.g. a new device is added or removed).</para>
  90. </listitem>
  91. </varlistentry>
  92. <varlistentry>
  93. <term id="hotplug-initscript"><command>hotplug</command> initscript</term>
  94. <listitem>
  95. <indexterm zone="ch-system-hotplug hotplug-initscript"><primary
  96. sortas="d-hotplug-initscript">hotplug</primary></indexterm>
  97. <para>This script just runs all
  98. <filename>/etc/hotplug/*.rc</filename> scripts in turn during system
  99. startup.</para>
  100. </listitem>
  101. </varlistentry>
  102. <varlistentry>
  103. <term id="hotplug-rc"><command>*.rc</command> files in
  104. <filename class="directory">/etc/hotplug</filename> directory</term>
  105. <listitem>
  106. <para>These scripts are used for cold plugging, i.e. detection and other
  107. specific actions upon hardware already present during system startup. These
  108. scripts try to find kernel modules corresponding to your hardware and insert
  109. them into the running kernel.
  110. </para>
  111. </listitem>
  112. </varlistentry>
  113. <varlistentry>
  114. <term id="hotplug-agent"><command>*.agent</command> files in
  115. <filename class="directory">/etc/hotplug</filename> directory</term>
  116. <listitem>
  117. <para>These scripts are called by <command>/sbin/hotplug</command>
  118. in response to different types of hotplug events generated by the kernel.
  119. Their action is to insert corresponding kernel modules and call user-provided
  120. scripts, if any.
  121. </para>
  122. </listitem>
  123. </varlistentry>
  124. <varlistentry>
  125. <term id="hotplug-functions"><filename>/etc/hotplug/hotplug.functions</filename></term>
  126. <listitem>
  127. <para>This file contains common functions used by other scripts in hotplug
  128. package.
  129. </para>
  130. </listitem>
  131. </varlistentry>
  132. <varlistentry>
  133. <term id="hotplug-blacklist"><filename>/etc/hotplug/blacklist</filename></term>
  134. <listitem>
  135. <indexterm zone="ch-system-hotplug hotplug-blacklist"><primary
  136. sortas="e-/etc/hotplug/blacklist">/etc/hotplug/blacklist</primary></indexterm>
  137. <para>This file contains the list of modules that should never be
  138. inserted into the kernel by hotplug scripts.
  139. </para>
  140. </listitem>
  141. </varlistentry>
  142. <varlistentry>
  143. <term id="hotplug-subdirs"><filename class="directory">/etc/hotplug/{pci,usb}</filename></term>
  144. <listitem>
  145. <para>These directories are supposed to contain user-written handlers for
  146. hotplug events.
  147. </para>
  148. </listitem>
  149. </varlistentry>
  150. <varlistentry>
  151. <term id="hotplug-usb.usermap"><filename>/etc/hotplug/usb.usermap</filename></term>
  152. <listitem>
  153. <indexterm zone="ch-system-hotplug hotplug-usb.usermap"><primary
  154. sortas="e-/etc/hotplug/usb.usermap">/etc/hotplug/usb.usermap</primary></indexterm>
  155. <para>This file contains rules that determine which user-defined handlers to
  156. call for each USB device, based on its vendor, id and other attributes.
  157. </para>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry>
  161. <term id="hotplug-hotplug.d"><filename class="directory">/etc/hotplug.d</filename></term>
  162. <listitem>
  163. <para>This directory contains programs (or symlinks to them)
  164. that are interested in receiving all hotplug events. E.g.,
  165. <application>udev</application> puts its symlink here during installation.
  166. </para>
  167. </listitem>
  168. </varlistentry>
  169. </variablelist>
  170. </sect1>