Skip to content

Commit

Permalink
package/cups: Add udev rules to assign usb printers group to lp
Browse files Browse the repository at this point in the history
This patch is based on patch from the rockchip tree:

commit c8a337593660f27379c30248a11bf08dc8712113
Author: Jeffy Chen <[email protected]>
Date:   Tue Nov 13 18:59:43 2018 +0800

    package: cups: Add udev rules to assign usb printers' group to lp

    Change-Id: Ieae17deaa7d3623e1f0e1cc826871f1719d98d88
    Signed-off-by: Jeffy Chen <[email protected]>

but removes a hardcoded device usb vendor/id and keps only the usb
printer class.

Signed-off-by: Angelo Compagnucci <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
  • Loading branch information
angeloc authored and arnout committed Sep 2, 2020
1 parent 608c12c commit 9c47056
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package/cups/70-usb-printers.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Allow USB printers in the lp group
# Match rules converted from usblp.c driver's usblp_ids
ACTION=="add", SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="07", ATTR{bInterfaceSubClass}=="01", GROUP="lp"
9 changes: 9 additions & 0 deletions package/cups/cups.mk
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ else
CUPS_CONF_OPTS += --disable-avahi
endif

ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
define CUPS_INSTALL_UDEV_RULES
$(INSTALL) -D -m 0644 package/cups/70-usb-printers.rules \
$(TARGET_DIR)/lib/udev/rules.d/70-usb-printers.rules
endef

CUPS_POST_INSTALL_TARGET_HOOKS += CUPS_INSTALL_UDEV_RULES
endif

define CUPS_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/cups/S81cupsd \
$(TARGET_DIR)/etc/init.d/S81cupsd
Expand Down

0 comments on commit 9c47056

Please sign in to comment.