Message-ID: <email address hidden>
Date: Wed, 7 Dec 2005 21:15:04 -0500
From: Aleksey Kliger <email address hidden>
To: <email address hidden>
Subject: some changes needed to udev script (nee hotplug script)
I believe that when /etc/hotplug/usb/libgphoto2 script is run by udevd
instead of hotplug (as with recent udev versions, and with hotplug
purged), the environment is somewhat different from what
the script expects. in particular if I add
to /etc/hotplug/usb/ligphoto2,
the output file contains the following after I plug in my camera:
=3D=3D=3D=3D=3D=3D
SUBSYSTEM=3Dusb
DEVPATH=3D/devices/pci0000:00/0000:00:03.0/usb1/1-2
ACTION=3Dadd
PWD=3D/
UDEV_LOG=3D3
UDEVD_EVENT=3D1
SHLVL=3D1
PHYSDEVDRIVER=3Dusb
PHYSDEVBUS=3Dusb
SEQNUM=3D993
_=3D/usr/bin/printenv
=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D
SUBSYSTEM=3Dusb
DEVPATH=3D/devices/pci0000:00/0000:00:03.0/usb1/1-2/1-2:1.0
ACTION=3Dadd
MODALIAS=3Dusb:v04A9p3070d0001dcFFdscFFdpFFic*isc*ip*
PWD=3D/
UDEV_LOG=3D3
UDEVD_EVENT=3D1
SHLVL=3D1
DEVICE=3D/proc/bus/usb/001/010
PRODUCT=3D4a9/3070/1
TYPE=3D255/255/255
PHYSDEVBUS=3Dusb
SEQNUM=3D994
_=3D/usr/bin/printenv
=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D
PHYSDEVPATH=3D/devices/pci0000:00/0000:00:03.0/usb1/1-2
SUBSYSTEM=3Dusb_device
DEVPATH=3D/class/usb_device/usbdev1.10
MINOR=3D9
ACTION=3Dadd
PWD=3D/
UDEV_LOG=3D3
MAJOR=3D189
UDEVD_EVENT=3D1
DEVNAME=3D/dev/bus/usb/1/10
SHLVL=3D1
PHYSDEVDRIVER=3Dusb
PHYSDEVBUS=3Dusb
SEQNUM=3D995
_=3D/usr/bin/printenv
=3D=3D=3D=3D=3D=3D
so as far as i can tell, the libgphoto2 script should replace
references to $DEVICE
with $DEVNAME, and moreover, the device is a character device not a
regular file.
so instead of -f, the test should be -c.
with those changes done to my local copy, I am able to plug in a
camera and import
photos as a non-root user (one that is a member of the camera group, obviou=
sly).
Message-ID: <email address hidden>
Date: Wed, 7 Dec 2005 21:15:04 -0500
From: Aleksey Kliger <email address hidden>
To: <email address hidden>
Subject: some changes needed to udev script (nee hotplug script)
I believe that when /etc/hotplug/ usb/libgphoto2 script is run by udevd
instead of hotplug (as with recent udev versions, and with hotplug
purged), the environment is somewhat different from what
the script expects. in particular if I add
echo "=3D=3D=3D=3D=3D" >> /tmp/script-output
printenv >> /tmp/script-output
echo "=3D=3D=3D=3D=3D" >> /tmp/script-output
to /etc/hotplug/ usb/ligphoto2, 3D/devices/ pci0000: 00/0000: 00:03.0/ usb1/1- 2 bin/printenv 3D/devices/ pci0000: 00/0000: 00:03.0/ usb1/1- 2/1-2:1. 0 3Dusb:v04A9p307 0d0001dcFFdscFF dpFFic* isc*ip* 3D/proc/ bus/usb/ 001/010 3D4a9/3070/ 1 bin/printenv 3D/devices/ pci0000: 00/0000: 00:03.0/ usb1/1- 2 3Dusb_device 3D/class/ usb_device/ usbdev1. 10 3D/dev/ bus/usb/ 1/10 bin/printenv
the output file contains the following after I plug in my camera:
=3D=3D=3D=3D=3D=3D
SUBSYSTEM=3Dusb
DEVPATH=
ACTION=3Dadd
PWD=3D/
UDEV_LOG=3D3
UDEVD_EVENT=3D1
SHLVL=3D1
PHYSDEVDRIVER=3Dusb
PHYSDEVBUS=3Dusb
SEQNUM=3D993
_=3D/usr/
=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D
SUBSYSTEM=3Dusb
DEVPATH=
ACTION=3Dadd
MODALIAS=
PWD=3D/
UDEV_LOG=3D3
UDEVD_EVENT=3D1
SHLVL=3D1
DEVICE=
PRODUCT=
TYPE=3D255/255/255
PHYSDEVBUS=3Dusb
SEQNUM=3D994
_=3D/usr/
=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D
PHYSDEVPATH=
SUBSYSTEM=
DEVPATH=
MINOR=3D9
ACTION=3Dadd
PWD=3D/
UDEV_LOG=3D3
MAJOR=3D189
UDEVD_EVENT=3D1
DEVNAME=
SHLVL=3D1
PHYSDEVDRIVER=3Dusb
PHYSDEVBUS=3Dusb
SEQNUM=3D995
_=3D/usr/
=3D=3D=3D=3D=3D=3D
so as far as i can tell, the libgphoto2 script should replace
references to $DEVICE
with $DEVNAME, and moreover, the device is a character device not a
regular file.
so instead of -f, the test should be -c.
with those changes done to my local copy, I am able to plug in a
camera and import
photos as a non-root user (one that is a member of the camera group, obviou=
sly).
Cheers,
Aleksey Kliger