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