:: Re: [DNG] vdev - scanner
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: fsmithred
Fecha:  
A: dng
Asunto: Re: [DNG] vdev - scanner
On 08/16/2016 12:49 PM, shraptor wrote:
> On 2016-08-16 18:19, shraptor wrote:
>> On 2016-08-16 18:11, shraptor wrote:
>>>> I got the scanner working.
>>>>
>>>> If I boot with udev, the scanner works, and the permissions on the device
>>>> look like this:
>>>>
>>>> ls -l /dev/bus/usb/002/
>>>> crw-rw-r--+ 1 root root 189, 137 Aug 16 10:30 010
>>>>
>>>> and with vdev, it looks like this:
>>>> crw------- 1 root root 189, 131 Aug 16 10:39 004
>>>>
>>>> I changed the permissions and added myself to the scanner group (oops!)
>>>> and now xsane finds the scanner when I'm running vdev. I hope someone
>>>> knows what to do with this information, because I'm in new territory
>>>> here.
>>>> (and I don't know C.)
>>>>
>>>> If udevadm output for the scanner would help, I'll post it. The udev
>>>> rules
>>>> for scanners are in /lib/udev/rules.d/60-libsane.rules
>>>
>>>
>>> Maybe you should write a vdev action for your scanner
>>> on my system they actions are in /etc/vdev/actions
>>>
>>> for instance optical.act contains
>>>
>>> [vdev-action]
>>> event=any
>>> path=^sr[0-9]*$
>>> VAR_OPTICAL_OWNER=root
>>> VAR_OPTICAL_GROUP=optical
>>> VAR_OPTICAL_MODE=0660
>>> helper=optical.sh
>>> daemonlet=true
>>> if_exists=run
>>>
>>>
>>>
>>> No C is needed. Write something that matches path like for optical
>>> path=^sr[0-9]*$
>>> then set needed permissions and group and vdev will fix it for you
>>>
>>>
>>> When you succeed you may contribute that .act file for others, yeah?
>>
>>
>> Maybe you can use something like null.act
>>
>> [vdev-action]
>> event=add
>> path=^null$
>> VAR_PERMISSIONS_MODE=0666
>> helper=permissions.sh
>> if_exists=run
>>
>>
>>
>> I mean the permissions.sh
>>
>>
>> so something like
>>
>> scanner.act
>>
>> [vdev-action]
>> event=add
>> path=^null$
>
>> VAR_PERMISSIONS_MODE=0664
>> helper=permissions.sh
>> if_exists=run
>>
>> Dunnow wot path you should use but maybe you could figure it out?
>
>
> perhaps?
>
> scanner.act
>
> [vdev-action]
> event=add
> path=^bus/usb/1$
> VAR_OWNER=root
> VAR_GROUP=scanner
> VAR_PERMISSIONS_MODE=0664
> helper=permissions.sh
> if_exists=run
>
>
> Does debian use something like /dev/usbscanner0 or /dev/usb/scanner0?
> Then maybe a new helper scanner.sh is needed, like optical.sh?
>
> In the beginning of vdev creation we dreamt of a udev rules to vdev action
> parser
>
>
>


Thanks! I'm reading the vdev primer now, so I don't know if any of what I
say makes sense.

I can't find anything under /dev with 'scan' in the name.
The scanner shows up at /dev/bus/usb/002/0nn where nn starts at 04
(there's already a 1,2 and 3 in that directory) and increments by one each
time I unplug and re-plug the scanner. there's also a /dev/bus/usb/001,
which is for the card reader on this laptop. So, I think the path would
have to be ^bus/usb/[000-999]/[000-999].

In addition to MODE=0664, there needs to be a way to do
setfacl -m -g:scanner:rw

OK, back to reading...

-fsr