hotplug.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 hotplug events
  12. generated by the kernel. Such events correspond to every change in the
  13. in the kernel state visible in the "sysfs" filesystem, e.g., the addition and
  14. removal of hardware. This package also detects existing hardware during
  15. boot and inserts the relevant modules into the running kernel.
  16. </para>
  17. <segmentedlist>
  18. <segtitle>&buildtime;</segtitle>
  19. <segtitle>&diskspace;</segtitle>
  20. <seglistitem><seg>0.01 SBU</seg><seg>0.1 MB</seg></seglistitem>
  21. </segmentedlist>
  22. </sect2>
  23. <sect2 role="installation">
  24. <title>Installation of Hotplug</title>
  25. <para>The isapnp.rc script included with hotplug has a minor syntax error,
  26. using return 0 outside a function definition where exit 0 should be used.
  27. The following command fixes this:</para>
  28. <screen><userinput>sed -i "s/|| return 0/|| exit 0/g" etc/hotplug/isapnp.rc</userinput></screen>
  29. <para>Install the Hotplug package:</para>
  30. <screen><userinput>make install</userinput></screen>
  31. <para>Remove Hotplug's not-so-clean init script, since we're going to be using
  32. the script including with LFS-Bootscripts:</para>
  33. <screen><userinput>rm -rf /etc/init.d</userinput></screen>
  34. <para>Network device hotplugging is not supported by LFS bootscripts yet. For
  35. that reason, remove the network hotplug agent:</para>
  36. <screen><userinput>rm -f /etc/hotplug/net.agent</userinput></screen>
  37. </sect2>
  38. <sect2 id="contents-hotplug" role="content"><title>Contents of Hotplug</title>
  39. <variablelist>
  40. <varlistentry id="hotplug">
  41. <term><command>/sbin/hotplug</command></term>
  42. <listitem>
  43. <indexterm zone="ch-system-hotplug hotplug"><primary
  44. sortas="b-hotplug">hotplug</primary></indexterm>
  45. <para>This script is called by default by Linux kernel when something
  46. changes in its internal state (e.g., a new device is added or removed).</para>
  47. </listitem>
  48. </varlistentry>
  49. <varlistentry id="hotplug-rc">
  50. <term><command>*.rc</command> files in
  51. <filename class="directory">/etc/hotplug</filename> directory</term>
  52. <listitem>
  53. <indexterm zone="ch-system-hotplug hotplug-rc"><primary
  54. sortas="e-/etc/hotplug/*.rc">/etc/hotplug/*.rc</primary></indexterm>
  55. <para>These scripts are used for cold plugging, i.e., detection and other
  56. specific actions upon hardware already present during system startup.
  57. They are called by the <filename>hotplug</filename> initscript that comes
  58. from the lfs-bootscripts package.
  59. The <command>*.rc</command>
  60. scripts try to recover hotplug events that were lost during system boot
  61. because, e.g., the root filesystem was not mounted by the kernel.
  62. </para>
  63. </listitem>
  64. </varlistentry>
  65. <varlistentry id="hotplug-agent">
  66. <term><command>*.agent</command> files in
  67. <filename class="directory">/etc/hotplug</filename> directory</term>
  68. <listitem>
  69. <indexterm zone="ch-system-hotplug hotplug-agent"><primary
  70. sortas="e-/etc/hotplug/*.agent">/etc/hotplug/*.agent</primary></indexterm>
  71. <para>These scripts are called by <command>/sbin/hotplug</command>
  72. in response to different types of hotplug events generated by the kernel.
  73. Their action is to insert corresponding kernel modules and call user-provided
  74. scripts, if any.
  75. </para>
  76. </listitem>
  77. </varlistentry>
  78. <varlistentry id="hotplug-functions">
  79. <term><filename>/etc/hotplug/hotplug.functions</filename></term>
  80. <listitem>
  81. <indexterm zone="ch-system-hotplug hotplug-functions"><primary
  82. sortas="e-/etc/hotplug/hotplug.functions">/etc/hotplug/hotplug.functions</primary></indexterm>
  83. <para>This file contains common functions used by other scripts in Hotplug
  84. package.
  85. </para>
  86. </listitem>
  87. </varlistentry>
  88. <varlistentry id="hotplug-blacklist">
  89. <term><filename>/etc/hotplug/blacklist</filename></term>
  90. <listitem>
  91. <indexterm zone="ch-system-hotplug hotplug-blacklist"><primary
  92. sortas="e-/etc/hotplug/blacklist">/etc/hotplug/blacklist</primary></indexterm>
  93. <para>This file contains the list of modules that should never be
  94. inserted into the kernel by hotplug scripts.
  95. </para>
  96. </listitem>
  97. </varlistentry>
  98. <varlistentry id="hotplug-subdirs">
  99. <term><filename class="directory">/etc/hotplug/{pci,usb}</filename></term>
  100. <listitem>
  101. <indexterm zone="ch-system-hotplug hotplug-subdirs"><primary
  102. sortas="e-/etc/hotplug/{pci,usb}">/etc/hotplug/{pci,usb}</primary></indexterm>
  103. <para>These directories are supposed to contain user-written handlers for
  104. hotplug events.
  105. </para>
  106. </listitem>
  107. </varlistentry>
  108. <varlistentry id="hotplug-usb.usermap">
  109. <term><filename>/etc/hotplug/usb.usermap</filename></term>
  110. <listitem>
  111. <indexterm zone="ch-system-hotplug hotplug-usb.usermap"><primary
  112. sortas="e-/etc/hotplug/usb.usermap">/etc/hotplug/usb.usermap</primary></indexterm>
  113. <para>This file contains rules that determine which user-defined handlers to
  114. call for each USB device, based on its vendor, id and other attributes.
  115. </para>
  116. </listitem>
  117. </varlistentry>
  118. <varlistentry id="hotplug-hotplug.d">
  119. <term><filename class="directory">/etc/hotplug.d</filename></term>
  120. <listitem>
  121. <indexterm zone="ch-system-hotplug hotplug-hotplug.d"><primary
  122. sortas="e-/etc/hotplug.d">/etc/hotplug.d</primary></indexterm>
  123. <para>This directory contains programs (or symlinks to them)
  124. that are interested in receiving hotplug events. E.g.,
  125. <application>udev</application> puts its symlink here during installation.
  126. </para>
  127. </listitem>
  128. </varlistentry>
  129. </variablelist>
  130. </sect2>
  131. </sect1>