Hotplug Support

Now that we've covered Linux USB and IEEE 1394 support, you should learn a little about Linux hotplug support, a system that can handle the automatic configuration and cleanup of devices when you plug them into the system.

The idea is simple; the kernel runs /sbin/hotplug when you plug in a device. Here's the procedure:

  1. You plug in a device. The kernel notices.

  2. The kernel runs /sbin/hotplug type, where type is the device type (usb, ieee1394, scsi, and so on). The kernel sets a number of device-related environment variables in the new hotplug process.

  3. The /etc/hotplug script runs /etc/hotplug/type.agent.

  4. The /etc/hotplug/type.agent script tries to configure the device.

There really isn't much more to it than this. Each device type's ...

Get How Linux Works now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.