Datasheet

“main” (Installation and Administration) 2004/6/25 13:29 page 318 #344
i
i
i
i
i
i
i
i
The hotplug system is not only used for devices that can be inserted and
removed during operation, but also for all devices only detected after the
kernel has been booted. These devices are entered in the sysfs file sys-
tem, which is mounted under /sys. Until the kernel has been booted, only
devices that are absolutely necessary, such as bus system, boot disks, or
keyboard, are initialized.
The most important hotplug functions are configured in two files. The first
of these, /etc/sysconfig/hotplug, contains variables that influence
the behavior of hotplug and coldplug. Every variable is explained by a
comment. The second file, /proc/sys/kernel/hotplug, contains the
name of the executable program called by the kernel.
14.1 Devices and Interfaces
As well as devices, the hotplug system also administers interfaces. A device
is either linked to a bus or an interface. An interface links devices to each
other or to an application.
Devices entered in the sysfs file are found under /sys/devices. In-
terfaces are located under /sys/class or /sys/block. All interfaces
should have a link to the related device in the sysfs file, but there are al-
ways some drivers that do not automatically add this link.
Typical examples of devices and interfaces include the following:
PCI Network Card A device linked to the PCI bus (/sys/devices/
pci0000:00/0000:00:1e.0/0000:02:00.0) that has a network
interface used by network services or linked to a virtual network de-
vice, such as a tunnel or VLAN. (/sys/class/net/eth0)
PCI SCSI Controller A device (/sys/devices/pci0000:20/0000:
20:01.1) that makes several physical interfaces available in the form
of a bus (/sys/class/scsi_host/host1).
SCSI Hard Disk A device (/sys/devices/pci0000:20/0000:20:
01.1/host1/1:0:0:0) with several interfaces (/sys/block/
sda*).
14.2 Hotplug Events
Every device and every interface has an associated hotplug event, which
is processed by the relevant hotplug agent. Hotplug events are triggered
318 14.1. Devices and Interfaces