The hotplug package is included in most current Linux distributions. However, the documentation on how to set it up for USB devices which use userspace drivers, such as many digital cameras.
These notes here are based on the current Debian distribution, it is possible that other distributions may place things in slightly different places.
Firstly ensure that you have the hotplug package installed, it's probably in your default install. To verify do either: dpkg -l hotplug (Debian) or rpm -q hotplug (Red Hat, SuSE etc.).
#!/bin/sh # usb-setvideo # Sets a hotplugged USB device to group video and gives it # group read/write access chgrp video $DEVICE chmod 0660 $DEVICEThis simply assigns the device to the video group and makes it readable and writable by any users who is a member of that group.
# The Canon Powershot S20 has Vendor ID 0X04A9, Product ID 0X3043 # the setvideo script just sets device ownership and permissions. setvideo 0x0000 0x04a9 0x3043 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000The important fields here are the second and third hex values which are the Vendor and Product IDs respectively. As far as I can tell the others are only to make up the numbers for user space scripts. For what it's worth the full list of parameters is:
module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass \ bInterfaceSubClass bInterfaceProtocol driver_info