dancing penguin

home page logo

[Home] [Chess] [Gallery] [Links] [Linux] [Palm] [GPG Key] [eBooks]

Bruno, long time ago

Wed, 09 Apr 2003 Olympus C-4040 hotplug script

I have an Olympus C-4040 Zoom Camera, and I usually copied files manually to my computer by mounting, copying, and unmounting the SCSI device.

As I started to use hotplug with my Sony PDA, I decided to automate this copy process.

Step 1: Prerequisites (It should work manually first!)

Your kernel should support usb-storage, which is out of the scope of this blog. If you have an out-of-the-box kernel (2.4.X) from an usual distro ( SuSE, RedHat, etc...), it should be fine anyway.
This link could you give some hints if you need.

Step 2: Add the following line to /etc/hotplug/usb.usermap.

olympus 0x0003 0x07b4 0x0105 0x0100 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000

The hex values 7b4/105/100 are the product code of the camera (dmesg should give you the information).

Step 3: Create a /etc/hotplug/usb/olympus script.

Download it here. This script should be made executable (chmod +x). Don't forget to change some variables too ($DESTDIR, $USER, and $GROUP).
Also, your /etc/fstab should contain something like (change $MOUNTPOINT if the mount point is different):

/dev/sda1 /usb auto noauto,user,sync 0 0

Step 4: Plug your camera to the usb port, and turn it on.

The pictures will be copied to the destination directory, automatically.
When the camera led stops blinking, it means that the copy is finished, so you can turn it off.
You will just have to delete the pictures from the camera later. This could be done in the script itself, but it may be dangerous. Just uncomment the rm line if you really wish to take the risk.

I do it myself, but after all this is my script ;-)

[/technical/linux] | permanent link | Google this