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