hotplug.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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" xreflabel="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. Apply the patch that avoids bogus dependencies of the hotplug initscript
  26. upon <application>which</application> and
  27. <application>usbutils</application> packages:
  28. </para>
  29. <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-bogus-deps-1.patch</userinput></screen>
  30. <para>
  31. USB coldplugging is somewhat broken in Hotplug by default. Fix this with the
  32. following patch:
  33. </para>
  34. <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-device-2.patch</userinput></screen>
  35. <para>
  36. At last, there is an optional patch that adds ISAPNP hardware detection
  37. capabilities to hotplug. It is not well tested. If you chose to apply it,
  38. run the following command:
  39. </para>
  40. <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-isapnp-2.patch
  41. </userinput></screen>
  42. <para>And finally install the hotplug package:</para>
  43. <screen><userinput>make install</userinput></screen>
  44. <para>Remove hotplug's not-so-clean init script, since we're going to be using
  45. the script including with LFS-Bootscripts:</para>
  46. <screen><userinput>rm -rf /etc/init.d</userinput></screen>
  47. <para>
  48. If you have applied the ISAPNP patch, add some required entries to
  49. <filename>/etc/modprobe.conf</filename>:</para>
  50. <screen><userinput>cat &gt;&gt;/etc/modprobe.conf &lt;&lt;"EOF"</userinput>
  51. # Begin /etc/modprobe.conf entries for ISAPNP hardware detection script
  52. # by Marco d'Itri
  53. alias pnp:dPNP0511 irtty-sir
  54. alias pnp:dPNP0700 floppy
  55. alias pnp:dPNP0800 pcspkr
  56. alias pnp:dPNP0B00 rtc
  57. alias pnp:dPNP0303 atkbd
  58. alias pnp:dPNP0F13 psmouse
  59. alias pnp:dPNPB02F analog
  60. # End /etc/modprobe.conf entries for ISAPNP hardware detection script
  61. <userinput>EOF</userinput></screen>
  62. <para>These entries may become unneded for newer versions of Linux kernel,
  63. since Marco d'Itri will try to convince developers to put them into the
  64. corresponding modules themselves.</para>
  65. </sect2>
  66. <sect2 id="contents-hotplug" role="content"><title>Contents of Hotplug</title>
  67. <variablelist>
  68. <varlistentry>
  69. <term id="hotplug"><command>/sbin/hotplug</command></term>
  70. <listitem>
  71. <indexterm zone="ch-system-hotplug hotplug"><primary
  72. sortas="b-hotplug">hotplug</primary></indexterm>
  73. <para>This script is called by default by Linux kernel when something
  74. changes in its internal state (e.g. a new device is added or removed).</para>
  75. </listitem>
  76. </varlistentry>
  77. <varlistentry>
  78. <term id="hotplug-initscript"><command>hotplug</command> initscript</term>
  79. <listitem>
  80. <indexterm zone="ch-system-hotplug hotplug-initscript"><primary
  81. sortas="d-hotplug-initscript">hotplug</primary></indexterm>
  82. <para>This script just runs all
  83. <filename>/etc/hotplug/*.rc</filename> scripts in turn during system
  84. startup.</para>
  85. </listitem>
  86. </varlistentry>
  87. <varlistentry>
  88. <term id="hotplug-rc"><command>*.rc</command> files in
  89. <filename class="directory">/etc/hotplug</filename> directory</term>
  90. <listitem>
  91. <para>These scripts are used for cold plugging, i.e. detection and other
  92. specific actions upon hardware already present during system startup. These
  93. scripts try to find kernel modules corresponding to your hardware and insert
  94. them into the running kernel.
  95. </para>
  96. </listitem>
  97. </varlistentry>
  98. <varlistentry>
  99. <term id="hotplug-agent"><command>*.agent</command> files in
  100. <filename class="directory">/etc/hotplug</filename> directory</term>
  101. <listitem>
  102. <para>These scripts are called by <command>/sbin/hotplug</command>
  103. in response to different types of hotplug events generated by the kernel.
  104. Their action is to insert corresponding kernel modules and call user-provided
  105. scripts, if any.
  106. </para>
  107. </listitem>
  108. </varlistentry>
  109. <varlistentry>
  110. <term id="hotplug-functions"><filename>/etc/hotplug/hotplug.functions</filename></term>
  111. <listitem>
  112. <para>This file contains common functions used by other scripts in hotplug
  113. package.
  114. </para>
  115. </listitem>
  116. </varlistentry>
  117. <varlistentry>
  118. <term id="hotplug-blacklist"><filename>/etc/hotplug/blacklist</filename></term>
  119. <listitem>
  120. <indexterm zone="ch-system-hotplug hotplug-blacklist"><primary
  121. sortas="e-/etc/hotplug/blacklist">/etc/hotplug/blacklist</primary></indexterm>
  122. <para>This file contains the list of modules that should never be
  123. inserted into the kernel by hotplug scripts.
  124. </para>
  125. </listitem>
  126. </varlistentry>
  127. <varlistentry>
  128. <term id="hotplug-subdirs"><filename class="directory">/etc/hotplug/{pci,usb}</filename></term>
  129. <listitem>
  130. <para>These directories are supposed to contain user-written handlers for
  131. hotplug events.
  132. </para>
  133. </listitem>
  134. </varlistentry>
  135. <varlistentry>
  136. <term id="hotplug-usb.usermap"><filename>/etc/hotplug/usb.usermap</filename></term>
  137. <listitem>
  138. <indexterm zone="ch-system-hotplug hotplug-usb.usermap"><primary
  139. sortas="e-/etc/hotplug/usb.usermap">/etc/hotplug/usb.usermap</primary></indexterm>
  140. <para>This file contains rules that determine which user-defined handlers to
  141. call for each USB device, based on its vendor, id and other attributes.
  142. </para>
  143. </listitem>
  144. </varlistentry>
  145. <varlistentry>
  146. <term id="hotplug-hotplug.d"><filename class="directory">/etc/hotplug.d</filename></term>
  147. <listitem>
  148. <para>This directory contains programs (or symlinks to them)
  149. that are interested in receiving all hotplug events. E.g.,
  150. <application>udev</application> puts its symlink here during installation.
  151. </para>
  152. </listitem>
  153. </varlistentry>
  154. </variablelist>
  155. </sect2>
  156. </sect1>