From: Angelo Compagnucci <angelo@amarulasolutions.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/6] package/cups: Add udev rules to assign usb printers group to lp
Date: Wed, 17 Jun 2020 19:28:46 +0200 [thread overview]
Message-ID: <20200617172848.2601-5-angelo@amarulasolutions.com> (raw)
In-Reply-To: <20200617172848.2601-1-angelo@amarulasolutions.com>
This patch is based on patch from the rockchip tree:
commit c8a337593660f27379c30248a11bf08dc8712113
Author: Jeffy Chen <jeffy.chen@rock-chips.com>
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 <jeffy.chen@rock-chips.com>
but fixes the missing lp user and group.
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
package/cups/70-usb-printers.rules | 4 ++++
package/cups/cups.mk | 14 ++++++++++++++
2 files changed, 18 insertions(+)
create mode 100644 package/cups/70-usb-printers.rules
diff --git a/package/cups/70-usb-printers.rules b/package/cups/70-usb-printers.rules
new file mode 100644
index 0000000000..537645523d
--- /dev/null
+++ b/package/cups/70-usb-printers.rules
@@ -0,0 +1,4 @@
+# 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"
+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0202", GROUP="lp"
diff --git a/package/cups/cups.mk b/package/cups/cups.mk
index 461e0d9143..d4356682bf 100644
--- a/package/cups/cups.mk
+++ b/package/cups/cups.mk
@@ -72,10 +72,24 @@ 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
@$(RM) $(TARGET_DIR)/etc/init.d/cups
$(INSTALL) -D -m 0755 package/cups/S81cupsd \
$(TARGET_DIR)/etc/init.d/S81cupsd
endef
+define CUPS_USERS
+ lp -1 lp -1 * /var/spool/lpd /bin/false - lp
+ - - lpadmin -1 * - - - Printers admin group.
+endef
+
$(eval $(autotools-package))
--
2.25.1
next prev parent reply other threads:[~2020-06-17 17:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 17:28 [Buildroot] [PATCH 0/6] Cups revamp Angelo Compagnucci
2020-06-17 17:28 ` [Buildroot] [PATCH 1/6] package/dejavu: Install dejavu fonts in staging dir Angelo Compagnucci
2020-06-17 17:28 ` [Buildroot] [PATCH 2/6] package/cups-filters: bump to version 1.27.5 Angelo Compagnucci
2020-06-17 17:28 ` [Buildroot] [PATCH 3/6] package/cups: bump to version 2.3.3 Angelo Compagnucci
2020-06-17 17:28 ` Angelo Compagnucci [this message]
2020-06-17 17:28 ` [Buildroot] [PATCH 5/6] package/cups: adding python support Angelo Compagnucci
2020-06-17 17:28 ` [Buildroot] [PATCH 6/6] package/qt5: Enable cups support when BR2_PACKAGE_CUPS Angelo Compagnucci
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200617172848.2601-5-angelo@amarulasolutions.com \
--to=angelo@amarulasolutions.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox