FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-15-2010, 03:09 AM
 
Default udev not assigning group correctly for scanner

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


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100714200905.512a9876@windy.deldotd.com">http://lists.debian.org/20100714200905.512a9876@windy.deldotd.com
 
Old 07-16-2010, 08:20 PM
Bill Dennen
 
Default udev not assigning group correctly for scanner

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 ...)

Regards
--
>@<
Bill Dennen ieee1014@hotmail.com
Of all the things I miss, I miss my mind the most ...


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: i1qeth$uu5$1@speranza.aioe.org">http://lists.debian.org/i1qeth$uu5$1@speranza.aioe.org
 
Old 07-17-2010, 01:04 AM
 
Default 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


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100716180449.4943f015@windy.deldotd.com">http://lists.debian.org/20100716180449.4943f015@windy.deldotd.com
 
Old 07-18-2010, 11:36 AM
Tzafrir Cohen
 
Default udev not assigning group correctly for scanner

On Wed, Jul 14, 2010 at 08:09:05PM -0700, briand@aracnet.com wrote:
> 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"

Where should $libsane_matched be set?

>
> 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.

1. Have you reloaded udev rules after your changes?

udevadm control --reload-rules

On Lenny:

udevadm control --reload_rules

2. udevmonitor (udevadm monitor) can help you see what you actually get
with the events. Use the option --env.

3. You seem to have quite a few conditions. Consider removing some of
them to see which one is the offender that does not apply.

>
> 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 ??

Are there any other rules that apply?

--
Tzafrir Cohen | tzafrir@jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir@cohens.org.il | | best
tzafrir@debian.org | | friend


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100718113625.GV17569@pear.tzafrir.org.il">http://lists.debian.org/20100718113625.GV17569@pear.tzafrir.org.il
 
Old 07-18-2010, 04:53 PM
 
Default udev not assigning group correctly for scanner

On Sun, 18 Jul 2010 11:36:25 +0000
Tzafrir Cohen <tzafrir@cohens.org.il> wrote:


> 1. Have you reloaded udev rules after your changes?
>
> udevadm control --reload-rules

that was one mistake I was making so I did

/etc/init.d/udev restart

>
> On Lenny:
>
> udevadm control --reload_rules
>
> 2. udevmonitor (udevadm monitor) can help you see what you actually
> get with the events. Use the option --env.
>

yes ! I figured this out. in fact I've been spending quality time with
udevadm.

>
> Are there any other rules that apply?
>

what I was really asking was "where do I put MY rules to make sure that
you dev tries to match them first. The answer I came up with was to
put a file "10-local.rules" in /etc/udev/rules.d.

This works just fine and now everything works as expected.

Brian


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100718095317.5f9108c5@windy.deldotd.com">http://lists.debian.org/20100718095317.5f9108c5@windy.deldotd.com
 

Thread Tools




All times are GMT. The time now is 05:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org