Differences between version 4 and previous revision of HotPlug.
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 4 | Last edited on Wednesday, March 31, 2004 9:53:52 pm | by JohnMcPherson | Revert |
Older page: | version 3 | Last edited on Thursday, November 27, 2003 2:54:05 pm | by JohnMcPherson | Revert |
@@ -7,9 +7,9 @@
"hotplug" is also the name of a linux package for managing the drivers/software side of things when hardware changes take place. For example, when [USB] devices are added or removed. There are other types of devices supported (such as CardBus/[PCMCIA] cards), but USB is the predominantly used type.
The way it works is that based on a device's identifying features, you can load different modules and run different scripts.
-In the
/etc/hotplug directory, there is
a file named usb.usermap. This gives the name of scripts to run for particular USB devices.
+Newer versions of hotplug have a set of "usermap" files in
/etc/hotplug/usb. (Older versions of hotplug use
a single
file named "/etc/hotplug/
usb.usermap"
.)
This gives the name of scripts to run for particular USB devices.
The file format is:
name_of_script fields_to_match field1 field2 field3 ... field11
@@ -23,17 +23,18 @@
# laser printer
brother_hl1440 0x0003 0x04f9 0x000d 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
So, when a USB device with vendor ID of 40a and product ID of 170 is inserted, hotplug will run the script named "usbcam" in the /etc/hotplug/usb directory.
-The 0x0003 tells hotplug to match this rule against only the vendor ID (1) + the product ID (2), ignoring all the other fields. You can determine these values by looking at your system logs (eg run dmesg(8)) after insertin
the [USB] device.
+The 0x0003 tells hotplug to match this rule against only the vendor ID (1) + the product ID (2), ignoring all the other fields. You can determine these values by looking at your system logs (eg run dmesg(8)) after inserting
the [USB] device.
+If you have the "usbutils" package installed, you could look in the file "/usr/share/misc/usb.ids" or run the "lsusb" command to get a description of connected USB devices
.
See below for notes about the scripts.
! Notes about editting the usb.usermap file
In the version of hotplug in [Debian] [Woody], you should add your changes to /etc/hotplug/usb.usermap-local and then run
# update-usb.usermap
-In more recent versions of hotplug, (such as Debian Testing/Unstable), it appears you can
create files named /etc/hotplug/usb/{foo}.usermap, for different versions of
foo.
+In more recent versions of hotplug, (such as Debian Testing/Unstable), create files named /etc/hotplug/usb/{foo}.usermap, for each script you have named
foo.
!! USB scripts
Make sure these scripts are executable! Hotplug will set the following environment variables for use by the scripts: