1
0
forked from pool/sane-backends

Accepting request 65396 from home:jsmeix:branches:graphics

Fixed udev rules for SCSI scanners using ATTRS for all sysfs attributes (bnc#681146)

OBS-URL: https://build.opensuse.org/request/show/65396
OBS-URL: https://build.opensuse.org/package/show/graphics/sane-backends?expand=0&rev=39
This commit is contained in:
Johannes Meixner 2011-03-29 13:19:37 +00:00 committed by Git OBS Bridge
parent 340cf56a2f
commit 2ef77a8b7c
2 changed files with 16 additions and 12 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Mar 29 13:07:20 CEST 2011 - jsmeix@suse.de
- Fixed udev rules for SCSI scanners:
For SCSI scanners "ATTRS" is mandatory for every sysfs attribute
(in particular ATTRS{type}, ATTRS{vendor}, and ATTRS{model})
so that "ATTRS" is replaced by "ATTR" only for USB scanners
(see openSUSE/Novell Bugzilla bnc#681146).
-------------------------------------------------------------------
Fri Mar 25 10:27:36 CET 2011 - jsmeix@suse.de

View File

@ -522,10 +522,7 @@ install -m644 autoconfig.rules %{buildroot}%{_sysconfdir}/udev/rules.d/56-sane-b
# Also the evil-hack init-script "sane-dev" is no longer provided.
# Regarding udev:
# Modify the generated tools/udev/libsane.rules file as follows:
# All GROUP="scanner" are replaced by GROUP="lp" and
# SUBSYSTEM=="usb" is added before the SUBSYSTEM=="usb_device" test
# but the latter is kept for backward compatibility.
# The reasons are:
# All GROUP="scanner" are replaced by GROUP="lp".
# There is no group "scanner" in /etc/group for openSUSE.
# For all-in-one devices (i.e. printer + scanner, e.g. "EPSON Stylus" devices)
# the group must be "lp" so that the CUPS usb backend which runs
@ -536,19 +533,17 @@ install -m644 autoconfig.rules %{buildroot}%{_sysconfdir}/udev/rules.d/56-sane-b
# usually require physical user access (to get the printed paper or
# to place a paper on the scanner) so that both kind of devices
# should usually require the same kind of security.
sed -i -e 's/GROUP="scanner"/GROUP="lp"/' tools/udev/libsane.rules
# Regarding SUBSYSTEM=="usb" see the Novell/Suse Bugzilla bug
# https://bugzilla.novell.com/show_bug.cgi?id=294161#c11
sed -i -e '/^SUBSYSTEM/s/"usb_device"/"usb"/' tools/udev/libsane.rules
# Regarding SYSFS{} or ATTRS{} versus ATTR{} see the Novell/Suse Bugzilla bug
# https://bugzilla.novell.com/show_bug.cgi?id=436085#c0
# but for SCSI scanners "ATTRS{type}" is mandatory see the Novell/Suse Bugzilla bug
# https://bugzilla.novell.com/show_bug.cgi?id=681146#c15
# so that "ATTRS{type}" which was replaced by "ATTR{type}" is re-replaced by "ATTRS{type}"
# but for SCSI scanners "ATTRS" is mandatory see the Novell/Suse Bugzilla bug
# https://bugzilla.novell.com/show_bug.cgi?id=681146#c20
# so that "ATTRS" is replaced by "ATTR" only for USB scanners.
sed -i -e '/^LABEL="libsane_usb_rules_begin"/,/^LABEL="libsane_usb_rules_end"/s/ATTRS/ATTR/g' tools/udev/libsane.rules
# Disable all ENV{DEVTYPE} lines because we (Suse/Novell) do not need them.
sed -i -e 's/GROUP="scanner"/GROUP="lp"/' tools/udev/libsane.rules
sed -i -e '/^SUBSYSTEM/s/"usb_device"/"usb"/' tools/udev/libsane.rules
sed -i -e 's/SYSFS/ATTR/g' tools/udev/libsane.rules
sed -i -e 's/ATTRS/ATTR/g' tools/udev/libsane.rules
sed -i -e 's/ATTR{type}/ATTRS{type}/g' tools/udev/libsane.rules
sed -i -e 's/^ENV{DEVTYPE}/# ENV{DEVTYPE}/' tools/udev/libsane.rules
# Disable entries for USB scanners which are "unsupported"
# but keep the entries for models for which the support status