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