From patchwork Wed Jun 17 17:28:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1311362 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=jVIDjXX6; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49nBrQ5v2Nz9sRR for ; Thu, 18 Jun 2020 03:29:10 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 55C438908A; Wed, 17 Jun 2020 17:29:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id naTxUpIUe0Zb; Wed, 17 Jun 2020 17:29:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id C6315891EA; Wed, 17 Jun 2020 17:29:08 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 12C7A1BF278 for ; Wed, 17 Jun 2020 17:29:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0ABBE8766E for ; Wed, 17 Jun 2020 17:29:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XZbtkTp5Sf0o for ; Wed, 17 Jun 2020 17:29:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by fraxinus.osuosl.org (Postfix) with ESMTPS id CCEBB87500 for ; Wed, 17 Jun 2020 17:28:59 +0000 (UTC) Received: by mail-wr1-f51.google.com with SMTP id e1so3228071wrt.5 for ; Wed, 17 Jun 2020 10:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q4Yp9z+5ZeYPPpfP/ow2jR5F40me0m+mOP/bcufnwpg=; b=jVIDjXX6g4AnUMs+t2MZRYR7Wp4eSoA+cnb1qu9t6ZpgfXDohP/1q3AJ/2r76l7G1C TzmQyW1BDUSGdMDdo2SPRTfkHxCBzYxQEQcMOdMrQ4iTrCwHskB4c+3qaIjwHFQmS2Rx sV3NzOwjyHN+pQfDb+AMCPO2l8FJH+PkVUYLY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q4Yp9z+5ZeYPPpfP/ow2jR5F40me0m+mOP/bcufnwpg=; b=sGzbtYrYRsUj4oKVH5ycfp2wFB383g8ECAA3Zl8B2bxhVxT2JYwAbkeo0W2/DDfPHd iDWFUejztPId6Cgu8YuDRS2oYZdDWd/NT9MLx/M5FQPGm3R/2TniTzXujnMNNvBTJCw7 GY2xeu/hxKTh/Do1zs+nSjwQBKxDQBB1NXwqB2EAumiUmJDcZboeccwNIE4rH3CzGnA4 2ymk7yhI2ah2obvGSnreRQEbtCGIw3Pn7QVNK+Fn4zPXmpmfji7JG9wvT/lsCjE+lBhu P5NRk84CxifO7+gk0w+l2vsX/DO06OZGCyi4jmWyA5mPtylHsG5yDsBvIdCBbbJ7jlxG 6q2g== X-Gm-Message-State: AOAM5323o0YFIRCubSPC8Q2qI0gqa6nmad3dzlho86gbpHxTIYOuXd9b qANTX+68xo+3el5Q0o3mz2hA2Rho6trHyw== X-Google-Smtp-Source: ABdhPJyXtqwu8Rc8KDI7+NnssZZ6uXnaW9w1OqWhkF8CGQ2eip6UxAxsfXB2eJI/wHtTrvfPS51ofg== X-Received: by 2002:a5d:4d4d:: with SMTP id a13mr352752wru.252.1592414937889; Wed, 17 Jun 2020 10:28:57 -0700 (PDT) Received: from localhost.localdomain (host194055151123.static.fidoka.tech. [194.55.151.123]) by smtp.gmail.com with ESMTPSA id n189sm406305wmb.43.2020.06.17.10.28.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 10:28:57 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 17 Jun 2020 19:28:46 +0200 Message-Id: <20200617172848.2601-5-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200617172848.2601-1-angelo@amarulasolutions.com> References: <20200617172848.2601-1-angelo@amarulasolutions.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 4/6] package/cups: Add udev rules to assign usb printers group to lp X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Trimarchi , Angelo Compagnucci Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch is based on patch from the rockchip tree: commit c8a337593660f27379c30248a11bf08dc8712113 Author: Jeffy Chen 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 but fixes the missing lp user and group. Signed-off-by: Michael Trimarchi Signed-off-by: Angelo Compagnucci --- 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))