%general-entities; ]> Hotplug-&hotplug-version; Hotplug <para>The Hotplug package contains scripts that react upon hotplug events generated by the kernel. Such events correspond to every change in the kernel state visible in the <systemitem class="filesystem">sysfs</systemitem> filesystem, e.g., the addition and removal of hardware. This package also detects existing hardware during boot and inserts the relevant modules into the running kernel.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem><seg>0.01 SBU</seg><seg>0.1 MB</seg></seglistitem> </segmentedlist> <segmentedlist> <segtitle>&dependencies;</segtitle> <seglistitem><seg>Unchecked</seg></seglistitem> </segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Hotplug Install the Hotplug package: make install Copy a file that the install target omits. cp etc/hotplug/pnp.distmap /etc/hotplug Remove the init script that Hotplug installs, since we're going to be using the script included with LFS-Bootscripts: rm -rf /etc/init.d Network device hotplugging is not supported by LFS bootscripts yet. For that reason, remove the network hotplug agent: rm -f /etc/hotplug/net.agent For logging of hotplug events we will create a directory and a blank file. This file will show all the information passed to hotplug: mkdir /var/log/hotplug touch /var/log/hotplug/events For firmware to be loaded by hotplug we will create the necessary directory: mkdir /lib/firmware Contents of Hotplug Installed program Installed scripts Installed files hotplug /etc/hotplug/*.rc, /etc/hotplug/*.agent /etc/hotplug/hotplug.functions, /etc/hotplug/blacklist, /etc/hotplug/{pci,usb}, /etc/hotplug/usb.usermap, /etc/hotplug.d, /var/log/hotplug/events Short Descriptions hotplug hotplug This script is called by default by Linux kernel when something changes in its internal state (e.g., a new device is added or removed). /etc/hotplug/*.rc /etc/hotplug/*.rc These scripts are used for cold plugging, i.e., detection and other specific actions upon hardware already present during system startup. They are called by the hotplug initscript that comes from the LFS-Bootscripts package. The *.rc scripts try to recover hotplug events that were lost during system boot because, e.g., the root filesystem was not mounted by the kernel. /etc/hotplug/*.agent /etc/hotplug/*.agent These scripts are called by hotplug in response to different types of hotplug events generated by the kernel. Their action is to insert corresponding kernel modules and call user-provided scripts, if any. /etc/hotplug/hotplug.functions /etc/hotplug/hotplug.functions This file contains common functions used by other scripts in Hotplug package. /etc/hotplug/blacklist /etc/hotplug/blacklist This file contains the list of modules that should never be inserted into the kernel by hotplug scripts. /etc/hotplug/{pci,usb} /etc/hotplug/{pci,usb} These directories are supposed to contain user-written handlers for hotplug events. /etc/hotplug/usb.usermap /etc/hotplug/usb.usermap This file contains rules that determine which user-defined handlers to call for each USB device, based on its vendor, id and other attributes. /var/log/hotplug/events /var/log/hotplug/events This file contains all the events since bootup that hotplug has called. /etc/hotplug.d /etc/hotplug.d This directory contains programs (or symlinks to them) that are interested in receiving hotplug events. E.g., Udev puts its symlink here during installation. /lib/firmware /lib/firmware This directory contains the firmware for devices that need to have there firmware loaded before use.