Bugzilla – Bug 142859
scanner access and resmgr
Last modified: 2006-01-31 14:54:29 UTC
In 10.0 we used resmgr config files to grant access to scanners (#100695) as libusb used to use resmgr to talk to usb devices. This does no longer work as libusb now directly accesses /dev/bus/usb and therefore no longer depends on resmgr. resmgr in turn does no longer need special handling of usb either, it can just install ACLs on /dev/bus/usb/*/*. Hal now parses files in /etc/hal/fdi/policy so YaST can write an fdi file there instead of a resmgr file. I'd suggest a file like /etc/hal/fdi/policy/10osvendor/70-resmgr-scanner.fdi with content e.g. <?xml version="1.0" encoding="ISO-8859-1"?> <deviceinfo version="0.2"> <device> <match key="linux.subsystem" string="usb"> <match key="usb.vendor_id" int="0x152e"> <match key="usb.product_id" int="0xe003"> <merge key="resmgr.class" type="string">scanner</merge> </match> </match> </match> </device> </deviceinfo>
Created attachment 63261 [details] patch to write fdi file
To eliminate the race when plugging in a scanner and resmgr trying to set the ACL before udev creates the device node Kay offered to implement a new device type we can match instead. It would be <match key="info.category" string="usbdev"> instead of <match key="linux.subsystem" string="usb"> in the fdi file.
Created attachment 63291 [details] updated patch Also assumes that vendor and product id are in the parent node. Can't test atm, needs an updated hal from Kay.
Change comitted to HAL CVS, the device is called "usbraw": udi = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_1d_0_usbraw' info.udi = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_1d_0_usbraw' (string) linux.device_file = '/dev/bus/usb/002/001' (string) linux.subsystem = 'usb_device' (string) linux.hotplug_type = 2 (0x2) (int) usbraw.device = '/dev/bus/usb/002/001' (string) info.product = 'USB Raw Device Access' (string) info.capabilities = {'usbraw'} (string list) info.category = 'usbraw' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_1d_0' (string) linux.sysfs_path = '/sys/class/usb_device/usbdev2.1' (string)
Many thanks! I already applied the first patch. I will change it accordingly. In patricular I will use: <match key="info.category" string="usbraw">
Ok, you also need add the @info.parent: stuff when matching for vendor and product ie. <match key="@info.parent:usb.vendor_id" int="0x152e"> instead of <match key="usb.vendor_id" int="0x152e"> I'll also need to update hal-resmgr to make this work.
Created attachment 63420 [details] /etc/hal/fdi/policy/10osvendor/80-scanner.fdi Submitted new yast2-scanner to STABLE. See this attachment what it writes in case of more than one scanner. Kay, is this correct now?
That should work. I just tried out hal cvs, the parent is usb_device so instead of usb.vendor_id we need to match usb_device.vendor_id...
Submitted changed (according to comment #8) package to STABLE.
Created attachment 63460 [details] /etc/hal/fdi/policy/10osvendor/80-scanner.fdi What the newest package version in STABLE would write.
If you need a scanner for testing: Go to my office and take the topmost scanner from the "scanner-stack". It is a Canon CanoScan Lide 30. It doesn't have a seperate power supply. It uses only USB power (i.e. your USB must provide sufficient power).
we need a new hal snapshot package to finally verify it.
10.1 beta1 works for me on caps.suse.de => I set it to FIXED.
For your information: With 10.1 beta2 it didn't work directly after a new installation. But it worked after one reboot and then it worked even for additionally set up scanners in the running system.
first boot was broken #145934