hotplug.xml 7.1 KB

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