mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user