View previous topic :: View next topic |
Author |
Message |
Kenji Miyamoto Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/108568614c11b737d3e30.jpg)
Joined: 28 May 2005 Posts: 1452 Location: Looking over your shoulder.
|
Posted: Sun May 21, 2006 10:32 am Post subject: Writing udev Rules |
|
|
How would I write a rule to change the permissions on the following device? I have no hotplug: Code: | looking at device '/class/usb_device/usbdev3.5':
KERNEL=="usbdev3.5"
SUBSYSTEM=="usb_device"
SYSFS{dev}=="189:260"
looking at device '/devices/pci0000:00/0000:00:13.1/usb3/3-1':
ID=="3-1"
BUS=="usb"
DRIVER=="usb"
SYSFS{configuration}==""
SYSFS{serial}=="KCKCY41700223"
SYSFS{product}=="KODAK EasyShare CX7430 Zoom Digital Camera"
SYSFS{manufacturer}=="Eastman Kodak Company"
SYSFS{maxchild}=="0"
SYSFS{version}==" 2.00"
SYSFS{devnum}=="5"
SYSFS{speed}=="12"
SYSFS{bMaxPacketSize0}=="8"
SYSFS{bNumConfigurations}=="1"
SYSFS{bDeviceProtocol}=="00"
SYSFS{bDeviceSubClass}=="00"
SYSFS{bDeviceClass}=="00"
SYSFS{bcdDevice}=="0100"
SYSFS{idProduct}=="057b"
SYSFS{idVendor}=="040a"
SYSFS{bMaxPower}==" 2mA"
SYSFS{bmAttributes}=="c0"
SYSFS{bConfigurationValue}=="1"
SYSFS{bNumInterfaces}==" 1" | The following rule doesn't work: Code: | # cat /etc/udev/rules.d/10-local.rules
BUS=="usb", SYSFS{idVendor}=="040a",MODE="0666",GROUP=camera,NAME="kodak%n" | The rulen does work (and I'ven changed kodak to camera), and the following device is created: Code: | crw-rw-rw- 1 root camera 189, 261 2006-05-21 03:49 /dev/camera6 | If the device node is created, gphoto2 cannot find the camera. Also, the procfs entry isn't changed: Code: | $ ls -lR /proc/bus/usb/
/proc/bus/usb/:
total 0
dr-xr-xr-x 2 root root 0 2006-05-21 03:42 001
dr-xr-xr-x 2 root root 0 2006-05-21 03:42 002
dr-xr-xr-x 2 root root 0 2006-05-21 03:42 003
-r--r--r-- 1 root root 0 2006-05-21 03:48 devices
/proc/bus/usb/001:
total 0
-rw-rw-r-- 1 root usb 43 2006-05-21 03:42 001
/proc/bus/usb/002:
total 0
-rw-rw-r-- 1 root usb 43 2006-05-21 03:42 001
/proc/bus/usb/003:
total 0
-rw-rw-r-- 1 root usb 43 2006-05-21 03:42 001
-rw-rw-r-- 1 root usb 57 2006-05-21 03:48 006 | How would I change this? _________________ [ Kawa-kun, new and improved!! ]
Alex Libman seems to be more of an anarchist than a libertarian. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ekutay l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 30 Mar 2005 Posts: 636 Location: Berlin
|
Posted: Sun May 21, 2006 12:24 pm Post subject: |
|
|
If you need a fixed device name, you should go for SYMLINK.
Code: | BUS=="usb", SYSFS{serial}=="KCKCY41700223", NAME="%k", SYMLINK="mykodak", GROUP="camera" |
This should give you a device node /dev/mykodak pointing to the real device. Btw. I would change the idVendor to serial, as the given vendor id doesn't look that specific. _________________ -- erol |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Kenji Miyamoto Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/108568614c11b737d3e30.jpg)
Joined: 28 May 2005 Posts: 1452 Location: Looking over your shoulder.
|
Posted: Sun May 21, 2006 9:22 pm Post subject: |
|
|
The thing is, I found out that the permissions to /proc/bus/usb need to be adjusted, since Gphoto2 uses the legacy interface. Is there a way to do this? _________________ [ Kawa-kun, new and improved!! ]
Alex Libman seems to be more of an anarchist than a libertarian. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ekutay l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 30 Mar 2005 Posts: 636 Location: Berlin
|
Posted: Sun May 21, 2006 9:54 pm Post subject: |
|
|
Maybe you can set the correct permissions in proc with a RUN in your udev rules iow faking hotplug . Something like Code: | RUN+="/usr/sbin/changepermission.sh" | You can also pass parameters to RUN rules. _________________ -- erol |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ekutay l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 30 Mar 2005 Posts: 636 Location: Berlin
|
Posted: Sun May 21, 2006 9:59 pm Post subject: |
|
|
Found this thingie regarding libusb vs. kernel drivers. That's more scanner related but if your GPhoto2 also relies on usbfs and libusb ... _________________ -- erol |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|