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 |
|
---|
10 | <indexterm zone="ch-system-hotplug"><primary sortas="a-Hotplug">Hotplug</primary></indexterm>
|
---|
11 |
|
---|
12 | <sect2 role="package"><title/>
|
---|
13 |
|
---|
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.
|
---|
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>
|
---|
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:
|
---|
37 | </para>
|
---|
38 |
|
---|
39 | <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-bogus_deps-1.patch</userinput></screen>
|
---|
40 |
|
---|
41 | <para>
|
---|
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:
|
---|
45 | </para>
|
---|
46 |
|
---|
47 | <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-device-2.patch</userinput></screen>
|
---|
48 |
|
---|
49 | <!-- Waiting for hotplug-2004_04_01-isapnp-4.patch
|
---|
50 | <para>
|
---|
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:
|
---|
54 | </para>
|
---|
55 |
|
---|
56 | <screen><userinput>patch -Np1 -i ../hotplug-&hotplug-version;-isapnp-2.patch</userinput></screen>
|
---|
57 | -->
|
---|
58 |
|
---|
59 | <para>Now install the Hotplug package:</para>
|
---|
60 |
|
---|
61 | <screen><userinput>make install</userinput></screen>
|
---|
62 |
|
---|
63 | <para>Remove Hotplug's not-so-clean init script, since we're going to be using
|
---|
64 | the script including with LFS-Bootscripts:</para>
|
---|
65 |
|
---|
66 | <screen><userinput>rm -rf /etc/init.d</userinput></screen>
|
---|
67 |
|
---|
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
|
---|
73 | <para>
|
---|
74 | If you have applied the ISAPNP patch, add some required entries to
|
---|
75 | <filename>/etc/modprobe.conf</filename>:</para>
|
---|
76 |
|
---|
77 | <screen><userinput>cat >>/etc/modprobe.conf <<"EOF"
|
---|
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
|
---|
88 | EOF</userinput></screen>
|
---|
89 |
|
---|
90 | <para>These entries may not be needed in newer versions of the Linux kernel,
|
---|
91 | since Marco d'Itri will try to convince developers to put them into the
|
---|
92 | corresponding modules themselves.</para>
|
---|
93 | -->
|
---|
94 | </sect2>
|
---|
95 |
|
---|
96 |
|
---|
97 | <sect2 id="contents-hotplug" role="content"><title>Contents of Hotplug</title>
|
---|
98 |
|
---|
99 | <variablelist>
|
---|
100 | <varlistentry id="hotplug">
|
---|
101 | <term><command>/sbin/hotplug</command></term>
|
---|
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
|
---|
106 | changes in its internal state (e.g., a new device is added or removed).</para>
|
---|
107 | </listitem>
|
---|
108 | </varlistentry>
|
---|
109 |
|
---|
110 | <varlistentry id="hotplug-rc">
|
---|
111 | <term><command>*.rc</command> files in
|
---|
112 | <filename class="directory">/etc/hotplug</filename> directory</term>
|
---|
113 | <listitem>
|
---|
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
|
---|
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>
|
---|
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.
|
---|
123 | </para>
|
---|
124 | </listitem>
|
---|
125 | </varlistentry>
|
---|
126 |
|
---|
127 | <varlistentry id="hotplug-agent">
|
---|
128 | <term><command>*.agent</command> files in
|
---|
129 | <filename class="directory">/etc/hotplug</filename> directory</term>
|
---|
130 | <listitem>
|
---|
131 | <indexterm zone="ch-system-hotplug hotplug-agent"><primary
|
---|
132 | sortas="e-/etc/hotplug/*.agent">/etc/hotplug/*.agent</primary></indexterm>
|
---|
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 |
|
---|
141 | <varlistentry id="hotplug-functions">
|
---|
142 | <term><filename>/etc/hotplug/hotplug.functions</filename></term>
|
---|
143 | <listitem>
|
---|
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
|
---|
147 | package.
|
---|
148 | </para>
|
---|
149 | </listitem>
|
---|
150 | </varlistentry>
|
---|
151 |
|
---|
152 | <varlistentry id="hotplug-blacklist">
|
---|
153 | <term><filename>/etc/hotplug/blacklist</filename></term>
|
---|
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 |
|
---|
163 | <varlistentry id="hotplug-subdirs">
|
---|
164 | <term><filename class="directory">/etc/hotplug/{pci,usb}</filename></term>
|
---|
165 | <listitem>
|
---|
166 | <indexterm zone="ch-system-hotplug hotplug-subdirs"><primary
|
---|
167 | sortas="e-/etc/hotplug/{pci,usb}">/etc/hotplug/{pci,usb}</primary></indexterm>
|
---|
168 | <para>These directories are supposed to contain user-written handlers for
|
---|
169 | hotplug events.
|
---|
170 | </para>
|
---|
171 | </listitem>
|
---|
172 | </varlistentry>
|
---|
173 |
|
---|
174 | <varlistentry id="hotplug-usb.usermap">
|
---|
175 | <term><filename>/etc/hotplug/usb.usermap</filename></term>
|
---|
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 |
|
---|
185 | <varlistentry id="hotplug-hotplug.d">
|
---|
186 | <term><filename class="directory">/etc/hotplug.d</filename></term>
|
---|
187 | <listitem>
|
---|
188 | <indexterm zone="ch-system-hotplug hotplug-hotplug.d"><primary
|
---|
189 | sortas="e-/etc/hotplug.d">/etc/hotplug.d</primary></indexterm>
|
---|
190 | <para>This directory contains programs (or symlinks to them)
|
---|
191 | that are interested in receiving hotplug events. E.g.,
|
---|
192 | <application>udev</application> puts its symlink here during installation.
|
---|
193 | </para>
|
---|
194 | </listitem>
|
---|
195 | </varlistentry>
|
---|
196 | </variablelist>
|
---|
197 | </sect2>
|
---|
198 | </sect1>
|
---|