[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: udev not assigning group correctly for scanner



On Fri, 16 Jul 2010 20:20:01 +0000 (UTC)
Bill Dennen <ieee1014@hotmail.com> wrote:

> On Thu, 15 Jul 2010 05:10:02 +0200, briand scribbled:
> 
> > device `epson2:/dev/sg1' is a Epson GT-9700 flatbed scanner
> > 
> > crw-rw----+ 1 root root 21, 1 Jul 14 18:57 /dev/sg1
> > 
> > here's the rule it looks like it should be matching :
> > 
> > 
> > # Epson Perfection 2450 | Epson GT-9700F | Epson Perfection 2450
> > PHOTO ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0112",
> > MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"
> > 
> > Because, you know, that's the scanner I have :-)
> > 
> > So I'm not clear on how I can figure out whether a rule was matched
> > at all, and if it was, which one was matched.
> > 
> > Also, what's the best way to add rules to /etc/udev to force "my"
> > rules to be checked first.  Do I simply add a rules file with a low
> > prefix number ??
> > 
> > Thanks,
> > 
> > Brian
> 
> Humor me, I suggested lspci -nn earlier and it's still the way ...
> udev will be matching on the vendor and device id fields.  In the
> stanza that's 0x04b8 and 0x0112 respectively.  If your device doesn't
> return those values then it isn't a match regardless of what the
> comment says.
> 
> (PS, you'd be surprised what is considered to be PCI ...)
> 

yes I did try that, and it's not useful, i.e. the scanner doesn't show
up. nothing which gets plugged into firewire or usb shows up there, so
I'm really not sure why you think that it should.

I don't know what version of udev your using but the version I'm using
doesn't seem to care about the idProduct fields.

This is the rule which i put in a scanner.rules file
in /etc/udev/rules.d:

KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="EPSON",
ATTRS{model}=="GT-9700", MODE="0664", GROUP="scanner",
ENV{libsane_matched}="yes"

which matches on the model and vendor strings and not the idVendor or
idProduct.

So there were two parts of to this problem:

1  users needed to be in the scanner group
2  libsane does not have a udev rule to match the scanner

I filed a wishlist bug against 2, so maybe someday the rule will make
it into the libsane distribution.

Brian


Reply to: