sane-backends: update to 1.0.29

- Migrate libusb dependency back to libsane
  (virtually all useful backends for OpenWrt would need it anyway)
- Disabled new usb-record-replay feature (avoid libxml2 dep)
- Disabled new escl backend (network-only backend are not too useful
  for OpenWrt and it requires libcurl, libnetsnmp, libavahi and libxml2)
- Workaround sane-daemon/postinst installation on Imagebuild
- Enabled backends kvs40xx and mustek_usb2 (fixed upstream)
- Fix bigendian compilation
  (https://gitlab.com/sane-project/backends/-/merge_requests/329)
- Fix missing std::round() for uclibc
  (https://gitlab.com/sane-project/backends/issues/237)
- Fixes FS#2685: coldplug was running before usblp was loaded. Now
  it grants access do usblp when a device using it is plugged.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
This commit is contained in:
Luiz Angelo Daros de Luca
2020-02-02 21:22:46 -03:00
parent 05e23f15d9
commit 0a85579e45
5 changed files with 70 additions and 26 deletions
+14 -13
View File
@@ -1,27 +1,28 @@
#!/bin/sh
[ "$ACTION" = "add" ] || exit 0
[ "$DEVTYPE" = "usb_device" ] || exit 0
[ "$ACTION" != "remove" ] || exit 0
SANE_GROUP=scanner
grep -q -E "^$SANE_GROUP:" /etc/group || exit 0
# Filter SANE known devices
vendor_product="${PRODUCT%/*}"
vendorid="$(printf '%04x' "0x0${vendor_product%/*}")"
productid="$(printf '%04x' "0x0${vendor_product#*/}")"
grep -s -x -F -q "$productid" "/usr/share/sane/$vendorid"-*.usbid || exit 0
grant() {
logger -t "hotplug(usb/20-saned)" "Granting $1 to '$2' for group '$SANE_GROUP'"
echo "hotplug(usb/20-saned): Granting $1 to '$2' for group '$SANE_GROUP'" >/dev/kmsg
chgrp "$SANE_GROUP" "$2"
chmod "$1" "$2"
}
# Needed by script /usr/bin/saned to rebind USB devices back to usblp after use
usblp_bind="/sys/bus/usb/drivers/usblp/bind"
if [ -e "$usblp_bind" ]; then
grant g+w "$usblp_bind"
if [ "$DEVTYPE" = "usb_device" ]; then
# Filter SANE known devices
vendor_product="${PRODUCT%/*}"
vendorid="$(printf '%04x' "0x0${vendor_product%/*}")"
productid="$(printf '%04x' "0x0${vendor_product#*/}")"
grep -s -x -F -q "$productid" "/usr/share/sane/$vendorid"-*.usbid || exit 0
grant g+rw "/dev/$DEVNAME"
elif [ "$DEVTYPE" = "usb_interface" ] && [ "$DRIVER" = 'usblp' ]; then
# Needed by script /usr/bin/saned to rebind USB devices back to usblp after use
if [ -e "$usblp_bind" ]; then
grant g+w "$usblp_bind"
fi
fi
grant g+rw "/dev/$DEVNAME"