From 6dda4ab76796de3f10913607ae97367adc78155d Mon Sep 17 00:00:00 2001 From: Juergen Daubert Date: Sun, 5 Mar 2006 10:45:28 +0000 Subject: [PATCH] use udev rules instead of hotplug to set device permissions --- sane/.footprint | 7 +++---- sane/Pkgfile | 8 ++++---- sane/README | 16 ++++++++-------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sane/.footprint b/sane/.footprint index da675316c..21a270dce 100644 --- a/sane/.footprint +++ b/sane/.footprint @@ -1,8 +1,7 @@ drwxr-xr-x root/root etc/ -drwxr-xr-x root/root etc/hotplug/ -drwxr-xr-x root/root etc/hotplug/usb/ --rw-r--r-- root/root etc/hotplug/usb/libsane.usermap --rwxr-xr-x root/root etc/hotplug/usb/libusbscanner +drwxr-xr-x root/root etc/udev/ +drwxr-xr-x root/root etc/udev/rules.d/ +-rw-r--r-- root/root etc/udev/rules.d/libsane.rules drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ -rwxr-xr-x root/root usr/bin/gamma4scanimage diff --git a/sane/Pkgfile b/sane/Pkgfile index 2d024ed92..e7d0f8b6e 100644 --- a/sane/Pkgfile +++ b/sane/Pkgfile @@ -5,7 +5,7 @@ name=sane version=1.0.17 -release=2 +release=3 source=(ftp://ftp.sane-project.org/pub/$name/$name-backends-$version/$name-backends-$version.tar.gz) build () { @@ -19,10 +19,10 @@ build () { make make prefix=$PKG/usr install - install -d $PKG/{etc/hotplug/usb,var/lock} + sh tools/udev/convert-usermap.sh tools/hotplug/libsane.usermap + install -d $PKG/{etc/udev/rules.d,var/lock} install -d -g scanner -m 775 $PKG/var/lock/sane - install -m 755 tools/hotplug/libusbscanner $PKG/etc/hotplug/usb - install -m 644 tools/hotplug/libsane.usermap $PKG/etc/hotplug/usb + install -m 644 libsane.rules $PKG/etc/udev/rules.d rm -r $PKG/usr/{doc,share} } diff --git a/sane/README b/sane/README index 3010ce932..fb9af4311 100644 --- a/sane/README +++ b/sane/README @@ -10,21 +10,21 @@ POST-INSTALL 1. To find the vendor/product id of your scanner, run the command: # sane-find-scanner -q - found USB scanner (vendor=0x04a9 [Canon], product=0x2204 [CanoScan] at libusb:002:002 + found USB scanner (vendor=0x04a9, product=0x2204 [CanoScan FB630U] at libusb:001:005 - You need the 'vendor' id (0x04a9) and the 'product' id (0x2204) + You need the 'vendor' id (04a9) and the 'product' id (2204) - 2. Check if /etc/hotplug/usb/libsane.usermap already knows about + 2. Check if /etc/udev/rules.d/libsane.rules already knows about your scanner. If your scanner is not in this list, add a line - like the following, remember to replace 0x04a9 and 0x2204 with + like the following, remember to replace 04a9 and 2204 with your values: - libusbscanner 0x0003 0x04a9 0x2204 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 - - 3. Check the file permissions in /proc/bus/usb after you have plugged + SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="2204", MODE="660", GROUP="scanner" + + 3. Check the file permissions in /dev/bus/usb after you have plugged in your scanner device. - # ls -l /proc/bus/usb/001 + # ls -l /dev/bus/usb/001 total 0 -rw-r--r-- 1 root root 43 Aug 3 10:58 001 -rw-rw---- 1 root scanner 50 Aug 3 10:58 005