hotplug.xml 7.0 KB

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