From patchwork Tue Jun 8 12:32:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamel BOUHARA X-Patchwork-Id: 1489424 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=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FzqPq4nRfz9sj1 for ; Tue, 8 Jun 2021 22:32:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id A3A45402B0; Tue, 8 Jun 2021 12:32:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7IPOMt32UkuH; Tue, 8 Jun 2021 12:32:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id F2C14400EE; Tue, 8 Jun 2021 12:32:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 86EE71BF2EA for ; Tue, 8 Jun 2021 12:32:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7660783AA7 for ; Tue, 8 Jun 2021 12:32:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wrxWaml5n9VD for ; Tue, 8 Jun 2021 12:32:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by smtp1.osuosl.org (Postfix) with ESMTPS id 401A5839BD for ; Tue, 8 Jun 2021 12:32:23 +0000 (UTC) Received: (Authenticated sender: kamel.bouhara@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 2D234100008; Tue, 8 Jun 2021 12:32:20 +0000 (UTC) From: Kamel Bouhara To: buildroot@buildroot.org Date: Tue, 8 Jun 2021 14:32:09 +0200 Message-Id: <20210608123210.143113-1-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/2] package/libqb: new package 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: Kamel Bouhara , Thomas Petazzoni , Miquel Raynal Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" libqb is a library providing features for client-server architecture, such as logging, tracing, inter-process communication (IPC) and polling. see: https://github.com/ClusterLabs/libqb Signed-off-by: Kamel Bouhara --- DEVELOPERS | 1 + package/Config.in | 1 + package/libqb/Config.in | 7 +++++++ package/libqb/libqb.hash | 3 +++ package/libqb/libqb.mk | 15 +++++++++++++++ 5 files changed, 27 insertions(+) create mode 100644 package/libqb/Config.in create mode 100644 package/libqb/libqb.hash create mode 100644 package/libqb/libqb.mk diff --git a/DEVELOPERS b/DEVELOPERS index a90ad1c354..94be28c43c 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1492,6 +1492,7 @@ F: package/dtach/ N: Kamel Bouhara F: package/libodb-boost/ F: package/libodb-mysql/ +F: package/libqb/ N: Karoly Kasza F: package/irqbalance/ diff --git a/package/Config.in b/package/Config.in index 82b28d2835..ad5dd1e860 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1930,6 +1930,7 @@ menu "Other" source "package/libpthread-stubs/Config.in" source "package/libpthsem/Config.in" source "package/libpwquality/Config.in" + source "package/libqb/Config.in" source "package/libseccomp/Config.in" source "package/libsigc/Config.in" source "package/libsigsegv/Config.in" diff --git a/package/libqb/Config.in b/package/libqb/Config.in new file mode 100644 index 0000000000..4ab010ca50 --- /dev/null +++ b/package/libqb/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_LIBQB + bool "libqb" + select BR2_PACKAGE_LIBXML2 + help + Library for client-server applications + + https://github.com/ClusterLabs/libqb diff --git a/package/libqb/libqb.hash b/package/libqb/libqb.hash new file mode 100644 index 0000000000..0a01a9bbb5 --- /dev/null +++ b/package/libqb/libqb.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 f72769c66479c51ac176b56837637b29d200f9dad40d23c5fdcb10f3a53ab1e4 libqb-2.0.2.tar.gz +sha256 00a89b0d18aacd4114decf79122db87bf35bddaf2bc50e383c9c9f4c263390b2 COPYING diff --git a/package/libqb/libqb.mk b/package/libqb/libqb.mk new file mode 100644 index 0000000000..9da6d7f900 --- /dev/null +++ b/package/libqb/libqb.mk @@ -0,0 +1,15 @@ +################################################################################ +# +# libqb +# +################################################################################ + +LIBQB_VERSION = 2.0.2 +LIBQB_SITE = $(call github,ClusterLabs,libqb,v$(LIBQB_VERSION)) +LIBQB_LICENSE = LGPL-2.1+ +LIBQB_LICENSE_FILES = COPYING +LIBQB_INSTALL_STAGING = YES +LIBQB_AUTORECONF = YES +LIBQB_DEPENDENCIES = libxml2 + +$(eval $(autotools-package)) From patchwork Tue Jun 8 12:32:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamel BOUHARA X-Patchwork-Id: 1489425 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=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FzqQ35656z9t0p for ; Tue, 8 Jun 2021 22:32:43 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 8C05E839BD; Tue, 8 Jun 2021 12:32:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JFxlk_x3uMSS; Tue, 8 Jun 2021 12:32:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id BF5C683AA7; Tue, 8 Jun 2021 12:32:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 5DEAA1BF2EA for ; Tue, 8 Jun 2021 12:32:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 492AB4045E for ; Tue, 8 Jun 2021 12:32:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rpKyY6yVW4ja for ; Tue, 8 Jun 2021 12:32:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by smtp4.osuosl.org (Postfix) with ESMTPS id 904524045B for ; Tue, 8 Jun 2021 12:32:27 +0000 (UTC) Received: (Authenticated sender: kamel.bouhara@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 7DF90FF802; Tue, 8 Jun 2021 12:32:24 +0000 (UTC) From: Kamel Bouhara To: buildroot@buildroot.org Date: Tue, 8 Jun 2021 14:32:10 +0200 Message-Id: <20210608123210.143113-2-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210608123210.143113-1-kamel.bouhara@bootlin.com> References: <20210608123210.143113-1-kamel.bouhara@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 2/2] package/usbguard: new package 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: Kamel Bouhara , Thomas Petazzoni , Miquel Raynal Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" usbguard is a software framework to implement USB device blacklisting and whitelisting based on their attributes. More info. on: https://usbguard.github.io/ Signed-off-by: Kamel Bouhara Tested-by: Miquel Raynal --- Changes v1 -> v2 - Removed strict dependency on systemd - Added a default initscript example for sysVinit system --- DEVELOPERS | 1 + package/Config.in | 1 + package/usbguard/Config.in | 15 ++++++++++ package/usbguard/S20usbguard | 37 +++++++++++++++++++++++++ package/usbguard/usbguard.hash | 3 ++ package/usbguard/usbguard.mk | 50 ++++++++++++++++++++++++++++++++++ 6 files changed, 107 insertions(+) create mode 100644 package/usbguard/Config.in create mode 100644 package/usbguard/S20usbguard create mode 100644 package/usbguard/usbguard.hash create mode 100644 package/usbguard/usbguard.mk -- 2.30.2 diff --git a/DEVELOPERS b/DEVELOPERS index 94be28c43c..a825fe4300 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1493,6 +1493,7 @@ N: Kamel Bouhara F: package/libodb-boost/ F: package/libodb-mysql/ F: package/libqb/ +F: package/usbguard/ N: Karoly Kasza F: package/irqbalance/ diff --git a/package/Config.in b/package/Config.in index ad5dd1e860..79fa4abd6c 100644 --- a/package/Config.in +++ b/package/Config.in @@ -582,6 +582,7 @@ endmenu source "package/upower/Config.in" source "package/usb_modeswitch/Config.in" source "package/usb_modeswitch_data/Config.in" + source "package/usbguard/Config.in" source "package/usbmount/Config.in" source "package/usbutils/Config.in" source "package/w_scan/Config.in" diff --git a/package/usbguard/Config.in b/package/usbguard/Config.in new file mode 100644 index 0000000000..c291babb73 --- /dev/null +++ b/package/usbguard/Config.in @@ -0,0 +1,15 @@ +config BR2_PACKAGE_USBGUARD + bool "usbguard" + depends on BR2_USE_WCHAR # glib2 + depends on BR2_TOOLCHAIN_HAS_THREADS # glib2 + depends on BR2_USE_MMU # glib2 + depends on BR2_PACKAGE_PROTOBUF + select BR2_PACKAGE_LIBQB + help + The USBGuard software framework + + https://usbguard.github.io/ + +comment "usbguard needs a glibc toolchain w/ threads and wchar" + depends on BR2_USE_MMU + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/usbguard/S20usbguard b/package/usbguard/S20usbguard new file mode 100644 index 0000000000..b16d7b4aa2 --- /dev/null +++ b/package/usbguard/S20usbguard @@ -0,0 +1,37 @@ +#!/bin/sh +# +# Start psplash +# + +PIDFILE=/var/run/$NAME.pid + +start() { + printf "Starting usbguard daemon: " + test -d /var/log/usbguard || mkdir -p /var/log/usbguard + start-stop-daemon -b -S -q -m -p $PIDFILE --exec /usr/sbin/usbguard-daemon -- -f -s -c /etc/usbguard/usbguard-daemon.conf + [ $? = 0 ] && echo "OK" || echo "FAIL" +} + +stop() { + printf "Stopping usbguard daemon: " + start-stop-daemon -K -q -p $PIDFILE + [ $? = 0 ] && echo "OK" || echo "FAIL" +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/package/usbguard/usbguard.hash b/package/usbguard/usbguard.hash new file mode 100644 index 0000000000..fd77acc75a --- /dev/null +++ b/package/usbguard/usbguard.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 5617986cd5dd1a2d311041648a1977d836cf4e33a4121d7f82599f21496abc42 usbguard-1.0.0.tar.gz +sha256 a45d0bb572ed792ed34627a72621834b3ba92aab6e2cc4e04301dee7a728d753 LICENSE diff --git a/package/usbguard/usbguard.mk b/package/usbguard/usbguard.mk new file mode 100644 index 0000000000..72e9e6459a --- /dev/null +++ b/package/usbguard/usbguard.mk @@ -0,0 +1,50 @@ +################################################################################ +# +## usbguard +# +################################################################################ + +USBGUARD_VERSION = 1.0.0 +USBGUARD_SITE = https://github.com/USBGuard/usbguard/releases/download/usbguard-$(USBGUARD_VERSION) +USBGUARD_LICENSE = GPL-2.0+ +USBGUARD_LICENSE_FILES = LICENSE +USBGUARD_CONF_OPTS= --with-bundled-catch --with-bundled-pegtl \ + --disable-debug-build --without-dbus --without-polkit \ + --disable-seccomp --disable-umockdev --disable-systemd + +USBGUARD_DEPENDENCIES += libqb protobuf + +ifeq ($(BR2_PACKAGE_LIBOPENSSL),y) +USBGUARD_CONF_OPTS += --with-crypto-library=openssl +USBGUARD_DEPENDENCIES += libopenssl +endif +ifeq ($(BR2_PACKAGE_LIBGCRYPT),y) +USBGUARD_CONF_OPTS += --with-crypto-library=gcrypt +USBGUARD_DEPENDENCIES += libgcrypt +endif +ifeq ($(BR2_PACKAGE_LIBSODIUM),y) +USBGUARD_CONF_OPTS += --with-crypto-library=sodium +USBGUARD_DEPENDENCIES += libsodium +endif + +ifeq ($(BR2_PACKAGE_SYSTEMD),y) +USBGUARD_CONF_OPTS += --enable-systemd +USBGUARD_DEPENDENCIES += systemd +endif + +ifeq ($(BR2_PACKAGE_LIBSECCOMP),y) +USBGUARD_CONF_OPTS += --enable-seccomp +USBGUARD_DEPENDENCIES += libseccomp +endif + +ifeq ($(BR2_PACKAGE_LIBCAP_NG),y) +USBGUARD_CONF_OPTS += --enable-libcapng +USBGUARD_DEPENDENCIES += libcap-ng +endif + +define USBGUARD_INSTALL_INIT_SYSV + $(INSTALL) -m 0755 -D package/usbguard/S20usbguard \ + $(TARGET_DIR)/etc/init.d/S20usbguard +endef + +$(eval $(autotools-package))