Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 49815 - add hotplug support for sane-backends 1.0.14
Summary: add hotplug support for sane-backends 1.0.14
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Patrick Kursawe (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-03 01:44 UTC by jochen
Modified: 2004-05-10 00:17 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2004-05-03 01:44:35 UTC
SANE backends v1.0.14 was released. the ebuild can basically stay the same, however, there's now support for hotplug included in the tarball:

in sane-backends-1.0.14/tools/hotplug there are three files:

o REAMDE -> /usr/share/sane-backends-1.0.14/README.hotplug
o libusbscanner -> /etc/hotplug/usb
  either add group scanner, or edit root:scanner to something existing in this file
o libsane.usermap -> /etc/hotplug/usb
  remove empty lines from this file, because usb.agent cannot parse them

furthermore, "scanner" should be added to /etc/hotplug/blacklist


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Patrick Kursawe (RETIRED) gentoo-dev 2004-05-06 01:18:48 UTC
1.0.14 is in portage since yesterday - about the hotplug support, I will have some trouble testing this since I don't have a scanner. Can you help me testing if I manage to make some ebuild from the README and your hints?

(summary line adjusted)
Comment 2 jochen 2004-05-06 05:54:27 UTC
Sure.

In my local ebuild, I have added this to src_compile:

    cd tools/hotplug
    cat libsane.usermap | grep -v '^$' > libsane.usermap.new
    mv libsane.usermap.new libsane.usermap

and this to src_install:

    cd tools/hotplug
    insinto /etc/hotplug/usb
    doins libsane.usermap libusbscanner
    newdoc README README.hotplug 
    cd ../..

both times right after the make invocation
Comment 3 Patrick Kursawe (RETIRED) gentoo-dev 2004-05-06 06:14:57 UTC
Did like you said, seems to do everything necessary in -r1. Please give it a try, re-open if there's a problem. Thanks!
Comment 4 jochen 2004-05-06 10:46:49 UTC
the ebuild works nice, however there is a small detail missing: the file /etc/hotplug/usb/libusbscanner should be executable
Comment 5 Stephan Kapfinger 2004-05-06 12:43:18 UTC
There is another issue with libusbscanner:
The script does not work with the latest versions of hotplug (20040401) and 2.6.x kernels. Hotplug uses the information in /sys/bus/usb/devices/* and leaves the $DEVICE variable (which should identify the device in /proc/bus/usb/*) empty.

A workaround for this problem:

if [ -z "$DEVICE" ] ; then
        IF=`echo $DEVPATH | sed 's/\(bus\/usb\/devices\/\)\(.*\)-\(.*\)/\2/'`
        DEV=`echo $DEVPATH | sed 's/\(bus\/usb\/devices\/\)\(.*\)-\(.*\)/\3/'`
        DEV=`expr $DEV + 1`
        DEVICE=`printf '/proc/bus/usb/%.03d/%.03d' $IF $DEV`
fi
Comment 6 jochen 2004-05-06 13:01:05 UTC
oh, cool

thanks for the tip, I fixed it in SANE's cvs

there's another problem: gentoo doesn't have group scanner, so either you add group scanner or change root:scanner to root:whatever in libusbscanner
Comment 7 Patrick Kursawe (RETIRED) gentoo-dev 2004-05-10 00:17:11 UTC
-r2 should fix these issues. Thanks for your help.