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