dancing penguin

home page logo

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

Bruno, long time ago

Weblog tree...
Archives...
  • First Ever Anti-Aging Gene Discovered In a Secluded Amish Community
  • What They Don't Tell You About Climate Change
  • Bitcoin Prices Surge 26% in November, Pass $8000
  • Net Neutrality is Essentially Unassailable, Argues Billionaire Barry Diller
  • Upsurge in Big Earthquakes Predicted for 2018
  • jesus christ rusty
Tue, 08 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