From patchwork Wed Jun 24 20:43: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: 1316579 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.138; helo=whitealder.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=VlsKe8Kf; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sZrK6B4vz9sSn for ; Thu, 25 Jun 2020 06:44:17 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4F6CA87858; Wed, 24 Jun 2020 20:44:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tz3mlSnRsVJa; Wed, 24 Jun 2020 20:44:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 677238785E; Wed, 24 Jun 2020 20:44:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 257D31BF2AA for ; Wed, 24 Jun 2020 20:44:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 218DA860CE for ; Wed, 24 Jun 2020 20:44:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M4fiyAg6gLss for ; Wed, 24 Jun 2020 20:44:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by whitealder.osuosl.org (Postfix) with ESMTPS id 95F5C86B18 for ; Wed, 24 Jun 2020 20:44:05 +0000 (UTC) Received: by mail-wr1-f46.google.com with SMTP id j4so1121438wrp.10 for ; Wed, 24 Jun 2020 13:44:05 -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=eFPlS/Lg8cCLaVOrMhLSoHxt/pKcJ3XuYQbGMKeQuMo=; b=VlsKe8KfhOKq+YmK4GProobOZajLa/lastGn83Jb2i6iTnU64yjr5rYGANjtqakT0T w+aT35GEdR1pd4kkY94hZi79pU24oHmfpeZJAZo9sRU8VgLmdFDHGX4FnCQrXv0QJWiv a8YQfwSixnOvwbZNQ6dQNZLFKosJ+MrSfWcGo= 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=eFPlS/Lg8cCLaVOrMhLSoHxt/pKcJ3XuYQbGMKeQuMo=; b=S8/XGF+Kzs+bick1NYIAnWxHTmgQGEsxAH+3oNfzHxaGQYHCn0FPEWKRtCH+SZyc4V 1yz26iQWZsO6DsyKSgwoOs/sjUAY+Mc0d4nABOxvCwENk/D6ZV6rDpKzlZpi4LXfnwuX yd+KEQTGAHwost8jmNn88LgaD5016FGbi53h7xarVUPgyEKgj0IuE8jMmAm+9x7B94Qe JjVWjMVlY7YnRGlLCJpF503kk1wCH8NLYeK/0ZDf3xZN4UYyAMM5ljpFreeeF0d3ymCX D27zJt+aXjI3DoiSS4M3OmvtcYgO67gXxkwTVEDK+28fD+6y+FWCZaMLMQqsiANX+BlF U4Ng== X-Gm-Message-State: AOAM530DVeEWnzh/PLVMM4STj/wpazaP6htz0emyAcvN/keLHiileqsN OvFXuRDmMweIz0ZNm9CopLl69v/9ht0Xjg== X-Google-Smtp-Source: ABdhPJzjOJwpew2DFUaso+jIuxSod0woM9Jc+vK7MGIrJhtZqRcxNz0Xr4A4yxZxuv8Jz/6YGvMcDQ== X-Received: by 2002:adf:f4c1:: with SMTP id h1mr31325448wrp.328.1593031443632; Wed, 24 Jun 2020 13:44:03 -0700 (PDT) Received: from localhost.localdomain (host194055151123.static.fidoka.tech. [194.55.151.123]) by smtp.gmail.com with ESMTPSA id 11sm9643996wmg.41.2020.06.24.13.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 13:44:03 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 24 Jun 2020 22:43:46 +0200 Message-Id: <20200624204347.797088-7-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200624204347.797088-1-angelo@amarulasolutions.com> References: <20200624204347.797088-1-angelo@amarulasolutions.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 6/7] 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 removes a hardcoded device usb vendor/id and keps only the usb printer class. Signed-off-by: Angelo Compagnucci Signed-off-by: Michael Trimarchi --- package/cups/70-usb-printers.rules | 3 +++ package/cups/cups.mk | 9 +++++++++ 2 files changed, 12 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..67e7f5e938 --- /dev/null +++ b/package/cups/70-usb-printers.rules @@ -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" diff --git a/package/cups/cups.mk b/package/cups/cups.mk index e86374b027..805a80e854 100644 --- a/package/cups/cups.mk +++ b/package/cups/cups.mk @@ -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 $(RM) $(TARGET_DIR)/etc/init.d/cups $(INSTALL) -D -m 0755 package/cups/S81cupsd \