source: chapter06/hotplug.xml@ d878ce3

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.0 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since d878ce3 was 3f91a9c, checked in by Alexander E. Patrakov <alexander@…>, 20 years ago

Various hotplug-related changes

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3848 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 7.2 KB
Line 
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
15generated by the kernel. Such events correspond to every change in the
16in the kernel state visible in the "sysfs" filesystem, e.g., the addition and
17removal of hardware. This package also detects existing hardware during
18boot 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>
32The <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.
35However, these programs are not called for any useful purpose.
36Apply 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>
42USB coldplugging is somewhat broken in <application>Hotplug</application>
43by default: the DEVICE environment variable is not passed to user-defined USB
44hotplug 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>
51There is an optional patch that adds ISAPNP hardware detection
52capabilities to Hotplug. It is not well tested and in fact contains known
53bugs. 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
64the 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
69that 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>
74If you have applied the ISAPNP patch, add some required entries to
75<filename>/etc/modprobe.conf</filename>:</para>
76
77<screen><userinput>cat &gt;&gt;/etc/modprobe.conf &lt;&lt;"EOF"
78# Begin /etc/modprobe.conf entries for ISAPNP hardware detection script
79# by Marco d'Itri
80alias pnp:dPNP0511 irtty-sir
81alias pnp:dPNP0700 floppy
82alias pnp:dPNP0800 pcspkr
83alias pnp:dPNP0B00 rtc
84alias pnp:dPNP0303 atkbd
85alias pnp:dPNP0F13 psmouse
86alias pnp:dPNPB02F analog
87# End /etc/modprobe.conf entries for ISAPNP hardware detection script
88EOF</userinput></screen>
89
90<para>These entries may not be needed in newer versions of the Linux kernel,
91since Marco d'Itri will try to convince developers to put them into the
92corresponding 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
104sortas="b-hotplug">hotplug</primary></indexterm>
105<para>This script is called by default by Linux kernel when something
106changes 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
115sortas="e-/etc/hotplug/*.rc">/etc/hotplug/*.rc</primary></indexterm>
116<para>These scripts are used for cold plugging, i.e., detection and other
117specific actions upon hardware already present during system startup.
118They are called by the <filename>hotplug</filename> initscript that comes
119from the lfs-bootscripts package.
120The <command>*.rc</command>
121scripts try to recover hotplug events that were lost during system boot
122because, 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
132sortas="e-/etc/hotplug/*.agent">/etc/hotplug/*.agent</primary></indexterm>
133<para>These scripts are called by <command>/sbin/hotplug</command>
134in response to different types of hotplug events generated by the kernel.
135Their action is to insert corresponding kernel modules and call user-provided
136scripts, 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
145sortas="e-/etc/hotplug/hotplug.functions">/etc/hotplug/hotplug.functions</primary></indexterm>
146<para>This file contains common functions used by other scripts in Hotplug
147package.
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
156sortas="e-/etc/hotplug/blacklist">/etc/hotplug/blacklist</primary></indexterm>
157<para>This file contains the list of modules that should never be
158inserted 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
167sortas="e-/etc/hotplug/{pci,usb}">/etc/hotplug/{pci,usb}</primary></indexterm>
168<para>These directories are supposed to contain user-written handlers for
169hotplug 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
178sortas="e-/etc/hotplug/usb.usermap">/etc/hotplug/usb.usermap</primary></indexterm>
179<para>This file contains rules that determine which user-defined handlers to
180call 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
189sortas="e-/etc/hotplug.d">/etc/hotplug.d</primary></indexterm>
190<para>This directory contains programs (or symlinks to them)
191that 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>
Note: See TracBrowser for help on using the repository browser.