use udev rules instead of hotplug to set device permissions

This commit is contained in:
Juergen Daubert 2006-03-05 10:45:28 +00:00
parent 2fa73c4ba6
commit 6dda4ab767
3 changed files with 15 additions and 16 deletions

View File

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

View File

@ -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}
}

View File

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