hotplug.xml 5.9 KB

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