/sbin/dpkg-reconfigure iscan-data
executes /usr/lib/iscan-data/make-policy-file
which, in the provided version 1.39.1, contains the following code:
get_footer () {
case "$MODE" in
udev)
line_count=`cat $1 | wc -l`
last=`sed -n '/{idProduct}/ =' $1 | tail -n 1`
num_lines=`expr $line_count \- $last`
tail -n $num_lines $1
;;
*)
mesg "internal error: inconsistent $MODE handling" >&2
exit 3
;;
esac
}
It determines that /lib/udev/rules.d/60-libsane.rules
has 86 lines ($line-count
) but fails to identify the last line containing {idProduct}
. The reason is that /lib/udev/rules.d/60-libsane.rules
does not contain any such line in Debian 10.
Unfortunately, get_header ()
and apparently also get_stanza ()
don't work with Debian 10, either. Hence, the resulting /lib/udev/rules.d/60-iscan.rules
is useless.
Without a proper udev
configuration, ordinary users will not be able to access the scanner.
My solution was to manually create /lib/udev/rules.d/60-iscan-manual.rules
which will survive an update of the iscan-data
package, at the risk of yielding a false match should the iscan
bundle be uninstalled (or its update drops support for my scanner). It contains a single matching entry for my particular scanner model. I took the values for idVendor
and idProduct
from lsusb
's output, so adapt those values for your particular model:
Bus 001 Device 026: ID 04b8:014a Seiko Epson Corp.
Here's my 60-iscan-manual.rules
:
# rules apply to "add" action only
# ================================
ACTION!="add", GOTO="iscan_man_rules_end"
# distribute to respective rules
# ==============================
ENV{DEVTYPE}=="usb_device", GOTO="iscan_man_usb_rules"
SUBSYSTEM=="usb_device", GOTO="iscan_man_usb_rules"
GOTO="iscan_man_rules_end"
# USB rules
# =========
LABEL="iscan_man_usb_rules"
# rules for supported USB scanners
ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="014a", ENV{libsane_matched}="yes"
# disable USB autosuspend, if the device was matched
ENV{libsane_matched}=="yes", TEST=="power/control", ATTR{power/control}="on"
GOTO="iscan_man_rules_end"
# END
# ===
LABEL="iscan_man_rules_end"