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