[72b0264] | 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 | ]>
|
---|
[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/>
|
---|
| 13 |
|
---|
[3f91a9c] | 14 | <para>The Hotplug package contains scripts that react upon hotplug events
|
---|
| 15 | generated by the kernel. Such events correspond to every change in the
|
---|
| 16 | in the kernel state visible in the "sysfs" filesystem, e.g., the addition and
|
---|
| 17 | removal of hardware. This package also detects existing hardware during
|
---|
| 18 | boot and inserts the relevant modules into the running kernel.
|
---|
[72b0264] | 19 | </para>
|
---|
| 20 | <segmentedlist>
|
---|
| 21 | <segtitle>&buildtime;</segtitle>
|
---|
| 22 | <segtitle>&diskspace;</segtitle>
|
---|
| 23 | <seglistitem><seg>0.01 SBU</seg><seg>0.1 MB</seg></seglistitem>
|
---|
| 24 | </segmentedlist>
|
---|
| 25 |
|
---|
| 26 | </sect2>
|
---|
| 27 |
|
---|
| 28 | <sect2 role="installation">
|
---|
| 29 | <title>Installation of Hotplug</title>
|
---|
| 30 |
|
---|
| 31 | <para>
|
---|
[3f91a9c] | 32 | The <command>usb.rc</command> script provided by the
|
---|
| 33 | <application>Hotplug</application> package depends on the programs
|
---|
| 34 | <command>usbutils</command> and <command>which</command> being present.
|
---|
| 35 | However, these programs are not called for any useful purpose.
|
---|
| 36 | Apply the patch that removes those dependencies:
|
---|
[72b0264] | 37 | </para>
|
---|
| 38 |
|
---|
[7db6ac5] | 39 | <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-bogus_deps-1.patch</userinput></screen>
|
---|
[72b0264] | 40 |
|
---|
| 41 | <para>
|
---|
[3f91a9c] | 42 | USB coldplugging is somewhat broken in <application>Hotplug</application>
|
---|
| 43 | by default: the DEVICE environment variable is not passed to user-defined USB
|
---|
| 44 | hotplug handlers. Fix this with the following patch:
|
---|
[72b0264] | 45 | </para>
|
---|
| 46 |
|
---|
[bad0dd1] | 47 | <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-device-2.patch</userinput></screen>
|
---|
[72b0264] | 48 |
|
---|
[3f91a9c] | 49 | <!-- Waiting for hotplug-2004_04_01-isapnp-4.patch
|
---|
[72b0264] | 50 | <para>
|
---|
[3f91a9c] | 51 | There is an optional patch that adds ISAPNP hardware detection
|
---|
| 52 | capabilities to Hotplug. It is not well tested and in fact contains known
|
---|
| 53 | bugs. If you chose to apply it, run the following command:
|
---|
[72b0264] | 54 | </para>
|
---|
| 55 |
|
---|
[17fadf7] | 56 | <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-isapnp-2.patch</userinput></screen>
|
---|
[3f91a9c] | 57 | -->
|
---|
[72b0264] | 58 |
|
---|
[3f91a9c] | 59 | <para>Now install the Hotplug package:</para>
|
---|
[72b0264] | 60 |
|
---|
| 61 | <screen><userinput>make install</userinput></screen>
|
---|
| 62 |
|
---|
[ef57e3b] | 63 | <para>Remove Hotplug's not-so-clean init script, since we're going to be using
|
---|
[bad0dd1] | 64 | the script including with LFS-Bootscripts:</para>
|
---|
[72b0264] | 65 |
|
---|
[bad0dd1] | 66 | <screen><userinput>rm -rf /etc/init.d</userinput></screen>
|
---|
[72b0264] | 67 |
|
---|
[3f91a9c] | 68 | <para>Network device hotplugging is not supported by LFS bootscripts yet. For
|
---|
| 69 | that reason, remove the network hotplug agent:</para>
|
---|
| 70 |
|
---|
| 71 | <screen><userinput>rm -f /etc/hotplug/net.agent</userinput></screen>
|
---|
| 72 | <!-- Will be useless with version 4 of the isapnp patch
|
---|
[72b0264] | 73 | <para>
|
---|
| 74 | If you have applied the ISAPNP patch, add some required entries to
|
---|
| 75 | <filename>/etc/modprobe.conf</filename>:</para>
|
---|
| 76 |
|
---|
[ef57e3b] | 77 | <screen><userinput>cat >>/etc/modprobe.conf <<"EOF"
|
---|
[72b0264] | 78 | # Begin /etc/modprobe.conf entries for ISAPNP hardware detection script
|
---|
| 79 | # by Marco d'Itri
|
---|
| 80 | alias pnp:dPNP0511 irtty-sir
|
---|
| 81 | alias pnp:dPNP0700 floppy
|
---|
| 82 | alias pnp:dPNP0800 pcspkr
|
---|
| 83 | alias pnp:dPNP0B00 rtc
|
---|
| 84 | alias pnp:dPNP0303 atkbd
|
---|
| 85 | alias pnp:dPNP0F13 psmouse
|
---|
| 86 | alias pnp:dPNPB02F analog
|
---|
| 87 | # End /etc/modprobe.conf entries for ISAPNP hardware detection script
|
---|
[ef57e3b] | 88 | EOF</userinput></screen>
|
---|
[72b0264] | 89 |
|
---|
[6f31272] | 90 | <para>These entries may not be needed in newer versions of the Linux kernel,
|
---|
[72b0264] | 91 | since Marco d'Itri will try to convince developers to put them into the
|
---|
| 92 | corresponding modules themselves.</para>
|
---|
[3f91a9c] | 93 | -->
|
---|
[72b0264] | 94 | </sect2>
|
---|
| 95 |
|
---|
| 96 |
|
---|
| 97 | <sect2 id="contents-hotplug" role="content"><title>Contents of Hotplug</title>
|
---|
| 98 |
|
---|
| 99 | <variablelist>
|
---|
[b8a819f] | 100 | <varlistentry id="hotplug">
|
---|
| 101 | <term><command>/sbin/hotplug</command></term>
|
---|
[72b0264] | 102 | <listitem>
|
---|
| 103 | <indexterm zone="ch-system-hotplug hotplug"><primary
|
---|
| 104 | sortas="b-hotplug">hotplug</primary></indexterm>
|
---|
| 105 | <para>This script is called by default by Linux kernel when something
|
---|
[ef57e3b] | 106 | changes in its internal state (e.g., a new device is added or removed).</para>
|
---|
[72b0264] | 107 | </listitem>
|
---|
| 108 | </varlistentry>
|
---|
| 109 |
|
---|
[b8a819f] | 110 | <varlistentry id="hotplug-rc">
|
---|
| 111 | <term><command>*.rc</command> files in
|
---|
[72b0264] | 112 | <filename class="directory">/etc/hotplug</filename> directory</term>
|
---|
| 113 | <listitem>
|
---|
[ef57e3b] | 114 | <indexterm zone="ch-system-hotplug hotplug-rc"><primary
|
---|
| 115 | sortas="e-/etc/hotplug/*.rc">/etc/hotplug/*.rc</primary></indexterm>
|
---|
| 116 | <para>These scripts are used for cold plugging, i.e., detection and other
|
---|
[5f98035] | 117 | specific actions upon hardware already present during system startup.
|
---|
| 118 | They are called by the <filename>hotplug</filename> initscript that comes
|
---|
| 119 | from the lfs-bootscripts package.
|
---|
| 120 | The <command>*.rc</command>
|
---|
[3f91a9c] | 121 | scripts try to recover hotplug events that were lost during system boot
|
---|
| 122 | because, e.g., the root filesystem was not mounted by the kernel.
|
---|
[72b0264] | 123 | </para>
|
---|
| 124 | </listitem>
|
---|
| 125 | </varlistentry>
|
---|
| 126 |
|
---|
[b8a819f] | 127 | <varlistentry id="hotplug-agent">
|
---|
| 128 | <term><command>*.agent</command> files in
|
---|
[72b0264] | 129 | <filename class="directory">/etc/hotplug</filename> directory</term>
|
---|
| 130 | <listitem>
|
---|
[ef57e3b] | 131 | <indexterm zone="ch-system-hotplug hotplug-agent"><primary
|
---|
| 132 | sortas="e-/etc/hotplug/*.agent">/etc/hotplug/*.agent</primary></indexterm>
|
---|
[72b0264] | 133 | <para>These scripts are called by <command>/sbin/hotplug</command>
|
---|
| 134 | in response to different types of hotplug events generated by the kernel.
|
---|
| 135 | Their action is to insert corresponding kernel modules and call user-provided
|
---|
| 136 | scripts, if any.
|
---|
| 137 | </para>
|
---|
| 138 | </listitem>
|
---|
| 139 | </varlistentry>
|
---|
| 140 |
|
---|
[b8a819f] | 141 | <varlistentry id="hotplug-functions">
|
---|
| 142 | <term><filename>/etc/hotplug/hotplug.functions</filename></term>
|
---|
[72b0264] | 143 | <listitem>
|
---|
[ef57e3b] | 144 | <indexterm zone="ch-system-hotplug hotplug-functions"><primary
|
---|
| 145 | sortas="e-/etc/hotplug/hotplug.functions">/etc/hotplug/hotplug.functions</primary></indexterm>
|
---|
| 146 | <para>This file contains common functions used by other scripts in Hotplug
|
---|
[72b0264] | 147 | package.
|
---|
| 148 | </para>
|
---|
| 149 | </listitem>
|
---|
| 150 | </varlistentry>
|
---|
| 151 |
|
---|
[b8a819f] | 152 | <varlistentry id="hotplug-blacklist">
|
---|
| 153 | <term><filename>/etc/hotplug/blacklist</filename></term>
|
---|
[72b0264] | 154 | <listitem>
|
---|
| 155 | <indexterm zone="ch-system-hotplug hotplug-blacklist"><primary
|
---|
| 156 | sortas="e-/etc/hotplug/blacklist">/etc/hotplug/blacklist</primary></indexterm>
|
---|
| 157 | <para>This file contains the list of modules that should never be
|
---|
| 158 | inserted into the kernel by hotplug scripts.
|
---|
| 159 | </para>
|
---|
| 160 | </listitem>
|
---|
| 161 | </varlistentry>
|
---|
| 162 |
|
---|
[b8a819f] | 163 | <varlistentry id="hotplug-subdirs">
|
---|
| 164 | <term><filename class="directory">/etc/hotplug/{pci,usb}</filename></term>
|
---|
[72b0264] | 165 | <listitem>
|
---|
[ef57e3b] | 166 | <indexterm zone="ch-system-hotplug hotplug-subdirs"><primary
|
---|
| 167 | sortas="e-/etc/hotplug/{pci,usb}">/etc/hotplug/{pci,usb}</primary></indexterm>
|
---|
[72b0264] | 168 | <para>These directories are supposed to contain user-written handlers for
|
---|
| 169 | hotplug events.
|
---|
| 170 | </para>
|
---|
| 171 | </listitem>
|
---|
| 172 | </varlistentry>
|
---|
| 173 |
|
---|
[b8a819f] | 174 | <varlistentry id="hotplug-usb.usermap">
|
---|
| 175 | <term><filename>/etc/hotplug/usb.usermap</filename></term>
|
---|
[72b0264] | 176 | <listitem>
|
---|
| 177 | <indexterm zone="ch-system-hotplug hotplug-usb.usermap"><primary
|
---|
| 178 | sortas="e-/etc/hotplug/usb.usermap">/etc/hotplug/usb.usermap</primary></indexterm>
|
---|
| 179 | <para>This file contains rules that determine which user-defined handlers to
|
---|
| 180 | call for each USB device, based on its vendor, id and other attributes.
|
---|
| 181 | </para>
|
---|
| 182 | </listitem>
|
---|
| 183 | </varlistentry>
|
---|
| 184 |
|
---|
[b8a819f] | 185 | <varlistentry id="hotplug-hotplug.d">
|
---|
| 186 | <term><filename class="directory">/etc/hotplug.d</filename></term>
|
---|
[72b0264] | 187 | <listitem>
|
---|
[ef57e3b] | 188 | <indexterm zone="ch-system-hotplug hotplug-hotplug.d"><primary
|
---|
| 189 | sortas="e-/etc/hotplug.d">/etc/hotplug.d</primary></indexterm>
|
---|
[72b0264] | 190 | <para>This directory contains programs (or symlinks to them)
|
---|
[3f91a9c] | 191 | that are interested in receiving hotplug events. E.g.,
|
---|
[72b0264] | 192 | <application>udev</application> puts its symlink here during installation.
|
---|
| 193 | </para>
|
---|
| 194 | </listitem>
|
---|
| 195 | </varlistentry>
|
---|
| 196 | </variablelist>
|
---|
[a4dadad2] | 197 | </sect2>
|
---|
[72b0264] | 198 | </sect1>
|
---|