From patchwork Mon Oct 28 09:03:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1185259 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MN3jMO6K"; 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 471pgd4zkZz9sP4 for ; Mon, 28 Oct 2019 20:04:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 55E888704A; Mon, 28 Oct 2019 09:04:26 +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 nFhTU2haaMmt; Mon, 28 Oct 2019 09:04:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id CE3D187089; Mon, 28 Oct 2019 09:04:25 +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 760861BF284 for ; Mon, 28 Oct 2019 09:04:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7340984526 for ; Mon, 28 Oct 2019 09:04:24 +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 ccXyQG9zP33x for ; Mon, 28 Oct 2019 09:04:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by fraxinus.osuosl.org (Postfix) with ESMTPS id A157384518 for ; Mon, 28 Oct 2019 09:04:23 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id w18so8968010wrt.3 for ; Mon, 28 Oct 2019 02:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9GihypAEX4fo4dXiOqzE+1fa5pYKGbLy9fRw78hmkas=; b=MN3jMO6K2bl4JJYQm78Zqqh8IrKOhkDcNZll37TM7gmdvAwGhsomqWFHjZQNimnLT5 dmE0/8KPZurxUZ90cMenAy0an7CH0N8MWVFI9vSngGnkLowzrPZpSuz5uG8tS75ciCpW kcJopiPkujIQoWA41IeDxAFM9tbai0Sez6dhhwqqVa4KAez1lQDjSvL0UYCDRATLQIsh 4HYb2dyqr1qiwZ+0w8GPVC9ORTEmZGV6yUOPeWILZa+vCvS+8SyUBfZnKeZu2rYoc6/b XYewi5vVkMp+kXHbq2aqq0xsiQ+17fWisP69RC3Y1c2AAG/61Aw2ue+rlRUJ3y/3bf2v qnoQ== 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=9GihypAEX4fo4dXiOqzE+1fa5pYKGbLy9fRw78hmkas=; b=OSddvpg1iR3JCbbFSt0qb3SOvFsAtGcJO0WhEhjG3+eDeTlpO40llBPBX1vIOEyRjt bvfGe1XCjz+lJb2T0aany1AAEBAWsNI793K88NLXUyEXFIyd7+BYPYfKFg9a4D02xrIh w9ii6HuJX91UkDT1tGlA5iOKsIwX9cw79Vy6hJE9rrF67wIlNmKr99vxXQpzEuenj0t8 oJfgiJAHZseGzbatQI4pDZXAPGgDpLdO6fPJNNRXDsigVj0Bo1okK4cYaqHTeuzex9oc xX7fxT/DNbP41DtDWIKJ1YxzgCax7u3J2Hm/QgmPzprM/N5aRkMjxhRPOkIm6oZ4x4uq zxcQ== X-Gm-Message-State: APjAAAUbUVU8siSreOosnlRewGSul0RcC/PoWChR/vuHDicwlnz54V5a rj4RfFdTEhSm7nSNIxcqwjTcerzd X-Google-Smtp-Source: APXvYqykgkaU3uxDfhKgYHhfBw6c3f61LHRw8ocIHzVslOcFPxJ56Z3I5EKk+3RrGNl6H0mD1OECfg== X-Received: by 2002:adf:e7c9:: with SMTP id e9mr13878168wrn.261.1572253461768; Mon, 28 Oct 2019 02:04:21 -0700 (PDT) Received: from hthiery01.sab.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id 26sm10344909wmi.17.2019.10.28.02.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 02:04:21 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Mon, 28 Oct 2019 10:03:25 +0100 Message-Id: <20191028090329.25432-2-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191028090329.25432-1-heiko.thiery@gmail.com> References: <20191028090329.25432-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 1/5] package/libev: use host-autotools-package macro 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: Heiko Thiery , thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Heiko Thiery Enable host support for the lib because the package host-sysrepo (depends on package libnetconf2) is needed by package netopeer2keystored. Signed-off-by: Heiko Thiery --- package/libev/libev.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/libev/libev.mk b/package/libev/libev.mk index 2b2d5db004..38b0530f62 100644 --- a/package/libev/libev.mk +++ b/package/libev/libev.mk @@ -18,3 +18,4 @@ endef LIBEV_POST_PATCH_HOOKS += LIBEV_DISABLE_EVENT_H_INSTALL $(eval $(autotools-package)) +$(eval $(host-autotools-package)) From patchwork Mon Oct 28 09:03:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1185261 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cVPqHJjI"; 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 471pgm34yvz9sP4 for ; Mon, 28 Oct 2019 20:04:36 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B811E81D7E; Mon, 28 Oct 2019 09:04:34 +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 FhiN526l5yw9; Mon, 28 Oct 2019 09:04:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A89D381DD2; Mon, 28 Oct 2019 09:04:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id D8FF41BF284 for ; Mon, 28 Oct 2019 09:04:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D586C2039B for ; Mon, 28 Oct 2019 09:04:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j7VJ2M46t-Lb for ; Mon, 28 Oct 2019 09:04:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by silver.osuosl.org (Postfix) with ESMTPS id C913120365 for ; Mon, 28 Oct 2019 09:04:24 +0000 (UTC) Received: by mail-wr1-f45.google.com with SMTP id z11so8915183wro.11 for ; Mon, 28 Oct 2019 02:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p7pcLZsCPpVoD9zcyTLHdaD0y9J3agubscb1tgIl2RE=; b=cVPqHJjIdssqZU5UGGZHDlfcsxl1xoI7Z1IUo8VCdTDeNUxyRXFwswYRUqzXhekzX6 iFRKidl+w2odZw+W7X698J4s+rF2m4wm8b1UUziiju9byWHVo5YGAHF8wS/zbRbvlkru HesejEHxf6QqtGLUf6/7LS5kexnJS+qTwp/9ZcUSdYYN4KazERoPYivOfcESTQs56B8y uYhTh2z8RJoIIExTvFhaccInRZhUkqQjs7REzp1UMDAeLREyPR8G5CheQiKJ8VXoGFiP INFmTPwt0L01nhcipdGmlrx3TVx6sdKYxo6qlL2H1sy5CQQJyxJcVlX9Rn4+rlDyBzsv +EfA== 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=p7pcLZsCPpVoD9zcyTLHdaD0y9J3agubscb1tgIl2RE=; b=hRSe3Ve5TnItJ51MhV7kVhC2iW2iXuKJtrDmbPNkUWoVI5iyI80rB2UUM8hYuIglwI gKkPX56naFncRzhJtnea3gOCgRSV4s7SnWvUvD9zuKJS2iWjnqLuofaYW9M/PjajIYwS DozBFXDvFbqMe13PPRx2RXV/vdTTHmOO4WArlIQKuEFFqxovGmvy40P8LPWVGbhgkckj qimn/cZu162ycipc9JA3Fq0JzvgOLy2AKEkgY7b57Bz+iBoLxD/3Y67bCrsGylY8b/gL j9F9WpAO6V3K89V/+HHaqpryTlVK1svN+gb+DVxPImJrCG9pvjWdVzgSSdvNh0tV2enO U9HA== X-Gm-Message-State: APjAAAWJauuKHsxiYzxs4QQ9f7t6h6kAcLY62uT2SeiDgYVTH6fMG4sO OU8re6iBn5QTMDjKJbfXYXsWP7oC X-Google-Smtp-Source: APXvYqzIaOkxBcrnhIKN5YX8r9Ew8fZAbg+eNLxrkGk5wVSCv6y2gzSbU6+TadVPwgnbdCvWC9S+7g== X-Received: by 2002:a5d:678e:: with SMTP id v14mr13534044wru.393.1572253462888; Mon, 28 Oct 2019 02:04:22 -0700 (PDT) Received: from hthiery01.sab.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id 26sm10344909wmi.17.2019.10.28.02.04.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 02:04:22 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Mon, 28 Oct 2019 10:03:26 +0100 Message-Id: <20191028090329.25432-3-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191028090329.25432-1-heiko.thiery@gmail.com> References: <20191028090329.25432-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 2/5] package/sysrepo: add 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: Heiko Thiery , Heiko Thiery , thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Heiko Thiery sysrepo is a YANG-based configuration and operational state data store for Unix/Linux applications. It is a dependency of Netopeer, a NETCONF server. Signed-off-by: Heiko Thiery --- DEVELOPERS | 1 + package/Config.in | 1 + ...espect-CMAKE_INSTALL_PREFIX-and-DEST.patch | 33 ++++++++++ ...t-make-systemd-unit-dir-configurable.patch | 40 +++++++++++++ package/sysrepo/Config.in | 35 +++++++++++ package/sysrepo/S50sysrepod | 45 ++++++++++++++ package/sysrepo/S51sysrepo-plugind | 50 ++++++++++++++++ package/sysrepo/sysrepo.hash | 2 + package/sysrepo/sysrepo.mk | 60 +++++++++++++++++++ 9 files changed, 267 insertions(+) create mode 100644 package/sysrepo/0001-CMakeLists.txt-respect-CMAKE_INSTALL_PREFIX-and-DEST.patch create mode 100644 package/sysrepo/0002-CMakeLists.txt-make-systemd-unit-dir-configurable.patch create mode 100644 package/sysrepo/Config.in create mode 100644 package/sysrepo/S50sysrepod create mode 100644 package/sysrepo/S51sysrepo-plugind create mode 100644 package/sysrepo/sysrepo.hash create mode 100644 package/sysrepo/sysrepo.mk diff --git a/DEVELOPERS b/DEVELOPERS index f41ac5f096..6f6b768e0d 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1048,6 +1048,7 @@ F: package/python-sip/ N: Heiko Thiery F: package/libnetconf2/ F: package/libyang/ +F: package/sysrepo/ N: Henrique Camargo F: package/json-glib/ diff --git a/package/Config.in b/package/Config.in index a1ac5069aa..ae1c5013b6 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1680,6 +1680,7 @@ menu "Networking" source "package/slirp/Config.in" source "package/snmppp/Config.in" source "package/sofia-sip/Config.in" + source "package/sysrepo/Config.in" source "package/thrift/Config.in" source "package/usbredir/Config.in" source "package/wampcc/Config.in" diff --git a/package/sysrepo/0001-CMakeLists.txt-respect-CMAKE_INSTALL_PREFIX-and-DEST.patch b/package/sysrepo/0001-CMakeLists.txt-respect-CMAKE_INSTALL_PREFIX-and-DEST.patch new file mode 100644 index 0000000000..5cb3606475 --- /dev/null +++ b/package/sysrepo/0001-CMakeLists.txt-respect-CMAKE_INSTALL_PREFIX-and-DEST.patch @@ -0,0 +1,33 @@ +From c4a2195febbd5d436f8de79d8391d8da9aa60ac4 Mon Sep 17 00:00:00 2001 +From: Michael Walle +Date: Thu, 10 Oct 2019 14:58:16 +0200 +Subject: [PATCH 1/2] CMakeLists.txt: respect CMAKE_INSTALL_PREFIX and DESTDIR + +Don't use absolute pathnames in the install function. This way the files +will be installed in the correct location even if CMAKE_INSTALL_PREFIX +and DESTDIR are changed. + +Patch comes from upstream pull-request: +https://github.com/sysrepo/sysrepo/pull/1638 + +Signed-off-by: Heiko Thiery +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4521088..14b7cd36 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -357,7 +357,7 @@ if(WITH_SYSTEMD) + ${PROJECT_SOURCE_DIR}/deploy/systemd/sysrepod.service + ${PROJECT_SOURCE_DIR}/deploy/systemd/sysrepo-plugind.service + ) +- install(DIRECTORY ${PROJECT_SOURCE_DIR}/deploy/systemd/ DESTINATION "/lib/systemd/system" ++ install(DIRECTORY ${PROJECT_SOURCE_DIR}/deploy/systemd/ DESTINATION "lib/systemd/system" + FILES_MATCHING PATTERN "*.service") + endif() + +-- +2.20.1 + diff --git a/package/sysrepo/0002-CMakeLists.txt-make-systemd-unit-dir-configurable.patch b/package/sysrepo/0002-CMakeLists.txt-make-systemd-unit-dir-configurable.patch new file mode 100644 index 0000000000..3ab75f7957 --- /dev/null +++ b/package/sysrepo/0002-CMakeLists.txt-make-systemd-unit-dir-configurable.patch @@ -0,0 +1,40 @@ +From 906927b4ee2dd0d5bd669d193fc851d14919fbd1 Mon Sep 17 00:00:00 2001 +From: Michael Walle +Date: Thu, 10 Oct 2019 14:38:57 +0200 +Subject: [PATCH 2/2] CMakeLists.txt: make systemd unit dir configurable + +Patch comes from upstream pull-request: +https://github.com/sysrepo/sysrepo/pull/1638 + +Signed-off-by: Heiko Thiery +--- + CMakeLists.txt | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 14b7cd36..14c84675 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -217,6 +217,9 @@ else() + message(FATAL_ERROR "Unknown file format \"${FILE_FORMAT_EXT}\", must be json, xml, or lyb.") + endif() + ++set(SYSTEMD_UNIT_DIR "lib/systemd/system/" CACHE STRING ++ "Path to the systemd service directory.") ++ + # timeouts + set(REQUEST_TIMEOUT 15 CACHE STRING + "Timeout (in seconds) for Sysrepo API requests. Set to 0 for no timeout.") +@@ -357,7 +360,8 @@ if(WITH_SYSTEMD) + ${PROJECT_SOURCE_DIR}/deploy/systemd/sysrepod.service + ${PROJECT_SOURCE_DIR}/deploy/systemd/sysrepo-plugind.service + ) +- install(DIRECTORY ${PROJECT_SOURCE_DIR}/deploy/systemd/ DESTINATION "lib/systemd/system" ++ install(DIRECTORY ${PROJECT_SOURCE_DIR}/deploy/systemd/ ++ DESTINATION "${SYSTEMD_UNIT_DIR}" + FILES_MATCHING PATTERN "*.service") + endif() + +-- +2.20.1 + diff --git a/package/sysrepo/Config.in b/package/sysrepo/Config.in new file mode 100644 index 0000000000..c2aac81ce9 --- /dev/null +++ b/package/sysrepo/Config.in @@ -0,0 +1,35 @@ +config BR2_PACKAGE_SYSREPO + bool "sysrepo" + depends on BR2_USE_MMU # libnetconf2 + depends on !BR2_STATIC_LIBS + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11 + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" # host-protbuf + select BR2_PACKAGE_LIBAVL + select BR2_PACKAGE_LIBEV + select BR2_PACKAGE_LIBNETCONF2 + select BR2_PACKAGE_LIBYANG + select BR2_PACKAGE_PCRE + select BR2_PACKAGE_PCRE_UCP + select BR2_PACKAGE_PROTOBUF_C + help + Sysrepo is an YANG-based configuration and operational state + data store for Unix/Linux applications. + + https://github.com/sysrepo + +if BR2_PACKAGE_SYSREPO + +config BR2_PACKAGE_SYSREPO_EXAMPLES + bool "enable examples" + help + Enable sysrepo examples. + +endif + +comment "sysrepo needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.8" + depends on BR2_USE_MMU + depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP \ + || !BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" diff --git a/package/sysrepo/S50sysrepod b/package/sysrepo/S50sysrepod new file mode 100644 index 0000000000..2a3c6c9cf5 --- /dev/null +++ b/package/sysrepo/S50sysrepod @@ -0,0 +1,45 @@ +#!/bin/sh + +DAEMON="sysrepod" +PIDFILE="/var/run/$DAEMON.pid" + +SYSREPOD_ARGS="" + +start() { + printf 'Starting %s: ' "$DAEMON" + start-stop-daemon -S -b -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ + -- $SYSREPOD_ARGS + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -q -p "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +restart() { + stop + sleep 1 + start +} + +case "$1" in + start|stop|restart) + "$1";; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac diff --git a/package/sysrepo/S51sysrepo-plugind b/package/sysrepo/S51sysrepo-plugind new file mode 100644 index 0000000000..7463712961 --- /dev/null +++ b/package/sysrepo/S51sysrepo-plugind @@ -0,0 +1,50 @@ +#!/bin/sh + +DAEMON="sysrepo-plugind" +PIDFILE="/var/run/$DAEMON.pid" + +SYSREPO_PLUGIND_ARGS="" + +start() { + printf 'Starting %s: ' "$DAEMON" + start-stop-daemon -S -b -q -p $PIDFILE -x "/usr/bin/$DAEMON" \ + -- $SYSREPO_PLUGIND_ARGS + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -q -p $PIDFILE + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +restart() { + stop + sleep 1 + start +} + +reload() { + # we do not support real reload .. just restart + restart +} + +case "$1" in + start|stop|restart|reload) + "$1";; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac diff --git a/package/sysrepo/sysrepo.hash b/package/sysrepo/sysrepo.hash new file mode 100644 index 0000000000..48d8290797 --- /dev/null +++ b/package/sysrepo/sysrepo.hash @@ -0,0 +1,2 @@ +sha256 d3066c1776a6727b96bbb3517eb646d0bb6037e8e1addcbe873cae590493843e sysrepo-0.7.8.tar.gz +sha256 28a773bfffa828ec38c030fc8ace5f3aeb90926ec1309bbd135441c4387ce3cd LICENSE diff --git a/package/sysrepo/sysrepo.mk b/package/sysrepo/sysrepo.mk new file mode 100644 index 0000000000..31317d6236 --- /dev/null +++ b/package/sysrepo/sysrepo.mk @@ -0,0 +1,60 @@ +################################################################################ +# +# sysrepo +# +################################################################################ + +SYSREPO_VERSION = 0.7.8 +SYSREPO_SITE = $(call github,sysrepo,sysrepo,v$(SYSREPO_VERSION)) +SYSREPO_INSTALL_STAGING = YES +SYSREPO_LICENSE = Apache-2.0 +SYSREPO_LICENSE_FILES = LICENSE +SYSREPO_DEPENDENCIES = libev libnetconf2 libavl libyang pcre protobuf-c host-sysrepo +HOST_SYSREPO_DEPENDENCIES = host-libev host-libnetconf2 host-libavl host-libyang host-pcre host-protobuf-c + +SYSREPO_CONF_OPTS = \ + -DGEN_PYTHON2_TESTS=OFF \ + -DENABLE_TESTS=OFF \ + -DGEN_CPP_BINDINGS=OFF \ + -DGEN_LANGUAGE_BINDINGS=OFF \ + -DGEN_PYTHON_BINDINGS=OFF \ + -DBUILD_CPP_EXAMPLES=OFF \ + -DCALL_SYSREPOCTL_BIN=$(HOST_DIR)/bin/sysrepoctl \ + -DCALL_SYSREPOCFG_BIN=$(HOST_DIR)/bin/sysrepocfg \ + -DBUILD_EXAMPLES=$(if $(BR2_PACKAGE_SYSREPO_EXAMPLES),ON,OFF) \ + $(if $(BR2_INIT_SYSTEMD),-DWITH_SYSTEMD=ON) \ + $(if $(BR2_INIT_SYSTEMD),-DSYSTEMD_UNIT_DIR=usr/lib/systemd/system) + +# On ARM, this is needed to prevent unaligned memory access with an optimized +# build .. https://github.com/sysrepo/sysrepo/issues/947 +SYSREPO_CONF_OPTS += -DUSE_SR_MEM_MGMT=OFF + +define SYSREPO_INSTALL_INIT_SYSV + $(INSTALL) -m 755 -D package/sysrepo/S50sysrepod \ + $(TARGET_DIR)/etc/init.d/S50sysrepod + $(INSTALL) -m 755 -D package/sysrepo/S51sysrepo-plugind \ + $(TARGET_DIR)/etc/init.d/S51sysrepo-plugind +endef + +define SYSREPO_INSTALL_INIT_SYSTEMD + mkdir -p $(TARGET_DIR)/etc/systemd/systemd/multi-user.target.wants + ln -fs ../../../../usr/lib/systemd/system/sysrepod.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + ln -fs ../../../../usr/lib/systemd/system/sysrepo-plugind.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants +endef + +HOST_SYSREPO_CONF_OPTS = \ + -DGEN_PYTHON2_TESTS=OFF \ + -DENABLE_TESTS=OFF \ + -DGEN_CPP_BINDINGS=OFF \ + -DGEN_LANGUAGE_BINDINGS=OFF \ + -DGEN_PYTHON_BINDINGS=OFF \ + -DCALL_TARGET_BINS_DIRECTLY=OFF \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_CPP_EXAMPLES=OFF \ + -DREPOSITORY_LOC=$(HOST_DIR)/etc/sysrepo \ + -DSUBSCRIPTIONS_SOCKET_DIR=$(HOST_DIR)/var/run/sysrepo-subscriptions + +$(eval $(cmake-package)) +$(eval $(host-cmake-package)) From patchwork Mon Oct 28 09:03:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1185263 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FvMFZ8n1"; 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 471pgq2Dqtz9sPV for ; Mon, 28 Oct 2019 20:04:39 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 531D78735E; Mon, 28 Oct 2019 09:04:36 +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 ZFJNd5280kL8; Mon, 28 Oct 2019 09:04:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id B7CAF870F6; Mon, 28 Oct 2019 09:04:32 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 1185B1BF284 for ; Mon, 28 Oct 2019 09:04:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0E6B120365 for ; Mon, 28 Oct 2019 09:04:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1jHIHoXYcrP6 for ; Mon, 28 Oct 2019 09:04:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by silver.osuosl.org (Postfix) with ESMTPS id D9D5520397 for ; Mon, 28 Oct 2019 09:04:25 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id n15so8910902wrw.13 for ; Mon, 28 Oct 2019 02:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qhRb6dOL9UHsWVBW0FXj7JMLh0XEXhEujhnIkcUMCvE=; b=FvMFZ8n1IQOeBpdCnEsIge7+0i+3yhNWsr1s0KCbRfyDJrcVzYIXJN7u0gpKPh8gHL CMpSo563MhZ/gjXdUolwpKQJc4kf74d6Kwf4ZGc7XSxiai15BaYcekT4LhABNsTs0WEV E3mfbAA0FW7mjTsGU0FR8PUI+O2rRD43jG51IMP2NbAS1PjmBwKDFmk1WRJFYd06frxd dQzAl3N56N4vLPuoyWaO195vwzd/A+nI1p1fo3xFFPQlRSYLJtQNduC+dV+MYRXlDcA3 nTwEgIcwtZuraffx+HOiT2+Qs5FFigRhkS0wiFgt+kX2b7ZNyD6zgC0mCK6BlQoq4bEM WvmQ== 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=qhRb6dOL9UHsWVBW0FXj7JMLh0XEXhEujhnIkcUMCvE=; b=kLKdYAcf5WROV5grw806j+CrbeXksjp01fAQOdc5XMuj4Yb2wvSI66kHJEFR7r+5wN 0TX2pX8YBwoQPEfXTwphA8ge2fhsv6LyTVXsraTOq76NxAqaT55C/bcHGASFkJwK2/g/ GK9tdF8lHtxYerAA8F89Avpe2XA3Qo8XhFslFeRpBD9z490oLfIb8Ua0chywR6BlM/jX V9RUU54EofpbgXOJIZjRZYN4bk8NVAXAYXhk5in0VzqVryNKEe6qsplpMJnaPxGhhT3Q c9oq8OM5KyPqi5o71zA5xmQdoAiKcqHGCxOMEDGafEcuG0MvJwJvmH6Lajpyld+F81AL TVpw== X-Gm-Message-State: APjAAAW/syJBOFDkfGvHoq7Dgj28K9nHmEtkezoQMdrOI3DuCSjK04rx ZKlwJLe5PJiOy/ClUXYIpvqhiBKP X-Google-Smtp-Source: APXvYqyCWJpsydi664bSiICym9Iz6NtsMCLyU3T6VoGsqDqeG5qom/Gd4bi9YUU8x554uzRzXeUM1A== X-Received: by 2002:a5d:4a45:: with SMTP id v5mr14301552wrs.358.1572253464037; Mon, 28 Oct 2019 02:04:24 -0700 (PDT) Received: from hthiery01.sab.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id 26sm10344909wmi.17.2019.10.28.02.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 02:04:23 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Mon, 28 Oct 2019 10:03:27 +0100 Message-Id: <20191028090329.25432-4-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191028090329.25432-1-heiko.thiery@gmail.com> References: <20191028090329.25432-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 3/5] package/netopeer2-keystored: add 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: Heiko Thiery , Heiko Thiery , thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Heiko Thiery netopeer2 keystored plugin. Signed-off-by: Heiko Thiery --- DEVELOPERS | 1 + package/Config.in | 1 + package/netopeer2-keystored/Config.in | 17 ++++++++++ .../netopeer2-keystored.hash | 2 ++ .../netopeer2-keystored.mk | 31 +++++++++++++++++++ 5 files changed, 52 insertions(+) create mode 100644 package/netopeer2-keystored/Config.in create mode 100644 package/netopeer2-keystored/netopeer2-keystored.hash create mode 100644 package/netopeer2-keystored/netopeer2-keystored.mk diff --git a/DEVELOPERS b/DEVELOPERS index 6f6b768e0d..0f0089dfaf 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1048,6 +1048,7 @@ F: package/python-sip/ N: Heiko Thiery F: package/libnetconf2/ F: package/libyang/ +F: package/netopeer2-keystored/ F: package/sysrepo/ N: Henrique Camargo diff --git a/package/Config.in b/package/Config.in index ae1c5013b6..1fcd7dd2d7 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1659,6 +1659,7 @@ menu "Networking" source "package/mongoose/Config.in" source "package/nanomsg/Config.in" source "package/neon/Config.in" + source "package/netopeer2-keystored/Config.in" source "package/nghttp2/Config.in" source "package/norm/Config.in" source "package/nss-mdns/Config.in" diff --git a/package/netopeer2-keystored/Config.in b/package/netopeer2-keystored/Config.in new file mode 100644 index 0000000000..d23ec2f1b9 --- /dev/null +++ b/package/netopeer2-keystored/Config.in @@ -0,0 +1,17 @@ +config BR2_PACKAGE_NETOPEER2_KEYSTORED + bool "netopeer2-keystored" + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_STATIC_LIBS + select BR2_PACKAGE_LIBYANG + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_SYSREPO + help + Netopeer2 is a set of tools implementing network + configuration tools based on the NETCONF Protocol. + + This is the keystored sysrepo plugin. + + https://github.com/CESNET/Netopeer2 + +comment "needs a toolchain w/ threads, dynamic libraray" + depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/netopeer2-keystored/netopeer2-keystored.hash b/package/netopeer2-keystored/netopeer2-keystored.hash new file mode 100644 index 0000000000..2ad5db9260 --- /dev/null +++ b/package/netopeer2-keystored/netopeer2-keystored.hash @@ -0,0 +1,2 @@ +sha256 59688271be4fecbbee671fc7eb3dc0538b13b4baab53e923e26eaeb33e6f7ec0 netopeer2-0.7-r2.tar.gz +sha256 932b75a8610a5c58e0fe0f70f8e4ebbcf3a2392acc16a88e95aebcdbdb9245e0 LICENSE diff --git a/package/netopeer2-keystored/netopeer2-keystored.mk b/package/netopeer2-keystored/netopeer2-keystored.mk new file mode 100644 index 0000000000..65a4c799b7 --- /dev/null +++ b/package/netopeer2-keystored/netopeer2-keystored.mk @@ -0,0 +1,31 @@ +################################################################################ +# +# netopeer2-keystored +# +################################################################################ + +NETOPEER2_KEYSTORED_VERSION = 0.7-r2 +NETOPEER2_KEYSTORED_SOURCE = netopeer2-$(NETOPEER2_KEYSTORED_VERSION).tar.gz +NETOPEER2_KEYSTORED_SITE = $(call github,CESNET,Netopeer2,v$(NETOPEER2_KEYSTORED_VERSION)) +NETOPEER2_KEYSTORED_DL_SUBDIR = netopeer2 +NETOPEER2_KEYSTORED_SUBDIR = keystored +NETOPEER2_KEYSTORED_LICENSE = BSD-3-Clause +NETOPEER2_KEYSTORED_LICENSE_FILES = LICENSE +NETOPEER2_KEYSTORED_DEPENDENCIES = host-sysrepo sysrepo + +NETOPEER2_KEYSTORED_CONF_OPTS = \ + -DKEYSTORED_DEFER_SSH_KEY=ON \ + -DSSH_KEY_INSTALL=ON \ + -DMODEL_INSTALL=ON \ + -DSYSREPOCTL_EXECUTABLE=$(HOST_DIR)/bin/sysrepoctl \ + -DSYSREPOCFG_EXECUTABLE=$(HOST_DIR)/bin/sysrepocfg + +define NETOPEER2_KEYSTORED_PERMISSIONS + /etc/sysrepo/data/ietf-keystore.persist f 600 0 0 - - - - - + /etc/sysrepo/data/ietf-keystore.running f 600 0 0 - - - - - + /etc/sysrepo/data/ietf-keystore.running.lock f 600 0 0 - - - - - + /etc/sysrepo/data/ietf-keystore.startup f 600 0 0 - - - - - + /etc/sysrepo/data/ietf-keystore.startup.lock f 600 0 0 - - - - - +endef + +$(eval $(cmake-package)) From patchwork Mon Oct 28 09:03:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1185264 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="B8C66pbq"; 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 471pgr5B9Vz9sP4 for ; Mon, 28 Oct 2019 20:04:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 39E66870F6; Mon, 28 Oct 2019 09:04:39 +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 Dds4UqIRXvFh; Mon, 28 Oct 2019 09:04:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E1268872A6; Mon, 28 Oct 2019 09:04:33 +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 3F2EA1BF284 for ; Mon, 28 Oct 2019 09:04:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3B52681D7E for ; Mon, 28 Oct 2019 09:04:29 +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 bAW+fzYIa6H4 for ; Mon, 28 Oct 2019 09:04:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2364482C36 for ; Mon, 28 Oct 2019 09:04:27 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id q130so8216088wme.2 for ; Mon, 28 Oct 2019 02:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uNbAXONZnGzFHbFzv3zJlDSqxou0QhY5YmZlPJJcx64=; b=B8C66pbqJc218d31k38RNdd6Ngndn5tlYrcRSZ3avk98MsTToqYlsG6fkm3IzgBOIO XNuxsvLnmXFJ963nXnqTLDK56Y226IBX+X/nDXWCLc1kBp8vpLnuo8+eExP2/GwDg49e NpH1oKE/vKmGQQQyh6bkJ/ZrAbMuMTJBcXC8QFLDvTY0E48QGvvCTUGQB3ZN76vIMIX2 SRzL37f3vqk6jIVwo4ohTlQZPJPBn45RkAvshah3A7cNsm3HiaZNXtCxDaEEsAgzkuJA 1LX//Emht2h0UX0xRsIy6XRaIAYvwkAyrq9fFeFbnA4I+yn9aZU8vS7gzAAEUb+K2I62 zkuQ== 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=uNbAXONZnGzFHbFzv3zJlDSqxou0QhY5YmZlPJJcx64=; b=SxhZsEnWQyQzXX7I4uM/Ge6llLrOLyJNNjqTR0768L/elaPai/8tgut516l7hdvY9O k7foPAYCuMuyLf4yXmZoolUtFsSNDnjI2NbELrm3bQ6ENqKfHTOYttvo58skb8IrnNqE SXAUcZi97TAoKzAVDXz5zNPJRc0dVmbuJQXFzV/uyMhqL8zDspfGOGAhSBLLykyoP1KV RjwVjKKX1wMPg21eYhd26g6tbbqIS/OOjHflexAhLs2BYxSdxi1g/y5IwcJFUiI+CoCG 5sHhLGpqWkwUkfbsNx+5WcS2FiWPsbeC5glS9yNBVY8+cb2Me7tGFzHfMbnF6agPZ3Tw RJBA== X-Gm-Message-State: APjAAAV0dhJGFYLfZNNbWOZHZ/4iefDqzPVsJrsb9IV8/O4KbFn66t2A LKUzeDkS9eiTjxPQxlHNQoxxAI3E X-Google-Smtp-Source: APXvYqwtdS6mdYGsLs9h6YdfjJxmRh03DtluESKeDdXvGFpUZ3LJnz3Ua+sgGskZwxn3JS8GME9JYg== X-Received: by 2002:a1c:4907:: with SMTP id w7mr14143878wma.62.1572253465227; Mon, 28 Oct 2019 02:04:25 -0700 (PDT) Received: from hthiery01.sab.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id 26sm10344909wmi.17.2019.10.28.02.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 02:04:24 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Mon, 28 Oct 2019 10:03:28 +0100 Message-Id: <20191028090329.25432-5-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191028090329.25432-1-heiko.thiery@gmail.com> References: <20191028090329.25432-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 4/5] package/netopeer2-server: add 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: Heiko Thiery , Heiko Thiery , thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Heiko Thiery Netopeer2 is a set of tools implementing network configuration tools based on the NETCONF Protocol. This is the second generation of the toolset, originally available as the Netopeer project. Netopeer2 is based on the new generation of the NETCONF and YANG libraries - libyang and libnetconf2. The Netopeer server uses sysrepo as a NETCONF datastore implementation. Signed-off-by: Heiko Thiery --- DEVELOPERS | 1 + package/Config.in | 1 + package/netopeer2-server/Config.in | 51 +++++++++++ package/netopeer2-server/S52netopeer2-server | 90 +++++++++++++++++++ .../netopeer2-server/netopeer2-server.hash | 1 + package/netopeer2-server/netopeer2-server.mk | 33 +++++++ 6 files changed, 177 insertions(+) create mode 100644 package/netopeer2-server/Config.in create mode 100644 package/netopeer2-server/S52netopeer2-server create mode 120000 package/netopeer2-server/netopeer2-server.hash create mode 100644 package/netopeer2-server/netopeer2-server.mk diff --git a/DEVELOPERS b/DEVELOPERS index 0f0089dfaf..217d044930 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1049,6 +1049,7 @@ N: Heiko Thiery F: package/libnetconf2/ F: package/libyang/ F: package/netopeer2-keystored/ +F: package/netopeer2-server/ F: package/sysrepo/ N: Henrique Camargo diff --git a/package/Config.in b/package/Config.in index 1fcd7dd2d7..aaecef433f 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1660,6 +1660,7 @@ menu "Networking" source "package/nanomsg/Config.in" source "package/neon/Config.in" source "package/netopeer2-keystored/Config.in" + source "package/netopeer2-server/Config.in" source "package/nghttp2/Config.in" source "package/norm/Config.in" source "package/nss-mdns/Config.in" diff --git a/package/netopeer2-server/Config.in b/package/netopeer2-server/Config.in new file mode 100644 index 0000000000..abae534a4b --- /dev/null +++ b/package/netopeer2-server/Config.in @@ -0,0 +1,51 @@ +comment "netopeer2server needs a toolchain w/ C++, threads, dynamic library, host gcc >= 4.8" + depends on BR2_USE_MMU + depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP \ + || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_HOST_GCC_AT_LEAST_4_8 + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" + +config BR2_PACKAGE_NETOPEER2_SERVER + bool "netopeer2-server" + depends on BR2_USE_MMU # sysrepo + depends on !BR2_STATIC_LIBS # sysrepo + depends on BR2_INSTALL_LIBSTDCPP # sysrepo + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_STATIC_LIBS + # host-protobuf only builds on certain architectures + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" + select BR2_PACKAGE_LIBAVL + select BR2_PACKAGE_LIBEV + select BR2_PACKAGE_LIBYANG + select BR2_PACKAGE_LIBNETCONF2 + select BR2_PACKAGE_PROTOBUF_C + select BR2_PACKAGE_PCRE + select BR2_PACKAGE_PCRE_UCP + select BR2_PACKAGE_SYSREPO + select BR2_PACKAGE_NETOPEER2_KEYSTORED + # at the moment SSH transport is mandatory + select BR2_PACKAGE_NETOPEER2_SERVER_SSH + + help + Netopeer2 is a set of tools implementing network + configuration tools based on the NETCONF Protocol. + + This is the server part. + + https://github.com/CESNET/Netopeer2 + +if BR2_PACKAGE_NETOPEER2_SERVER + +config BR2_PACKAGE_NETOPEER2_SERVER_TLS + bool "TLS transport" + select BR2_PACKAGE_OPENSSL + help + Enable TLS transport layer support. + +config BR2_PACKAGE_NETOPEER2_SERVER_SSH + bool "SSH transport" + select BR2_PACKAGE_LIBSSH + select BR2_PACKAGE_LIBSSH_SERVER + help + Enable SSH transport layer support. + +endif diff --git a/package/netopeer2-server/S52netopeer2-server b/package/netopeer2-server/S52netopeer2-server new file mode 100644 index 0000000000..0bad83325a --- /dev/null +++ b/package/netopeer2-server/S52netopeer2-server @@ -0,0 +1,90 @@ +#!/bin/sh + +DAEMON="netopeer2-server" +PIDFILE="/var/run/$DAEMON.pid" + +NETOPEER2_SERVER_ARGS="" + +KEYSTORED_HOST_KEY="/etc/keystored/keys/ssh_host_rsa_key.pem" + +SSHKEYGEN="/usr/bin/dropbearkey" +DROPBEARKEY="/usr/bin/dropbearkey" +DROPBEARCONVERT="/usr/bin/dropbearconvert" + +dropbear_keygen() { + ${DROPBEARKEY} -t rsa -f ${KEYSTORED_HOST_KEY} + ${DROPBEARCONVERT} dropbear openssh ${KEYSTORED_HOST_KEY} ${KEYSTORED_HOST_KEY} +} + +ssh_keygen() { + ${SSHKEYGEN} -m pem -t rsa -q -N "" -f ${KEYSTORED_HOST_KEY} +} + +keygen() { + if [ -x ${DROPBEARKEY} -a -x ${DROPBEARCONVERT} ]; then + dropbear_keygen + status=$? + elif [ -x ${SSHKEYGEN} ]; then + ssh_keygen + status=$? + else + status=1 + fi + + return "$status" +} + +start() { + printf 'Starting %s: ' "$DAEMON" + if [ ! -f ${KEYSTORED_HOST_KEY} ]; then + keygen + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + else + echo "OK" + fi + + start-stop-daemon -S -b -q -p $PIDFILE -x "/usr/bin/$DAEMON" \ + -- $NETOPEER2_SERVER_ARGS + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -q -p $PIDFILE + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +restart() { + stop + sleep 1 + start +} + +reload() { + # we do not support real reload .. just restart + restart +} + +case "$1" in + start|stop|restart|reload) + "$1";; + *) + echo "Usage: $0 {start|stop|restart|reload}" +esac diff --git a/package/netopeer2-server/netopeer2-server.hash b/package/netopeer2-server/netopeer2-server.hash new file mode 120000 index 0000000000..47bb47d7e3 --- /dev/null +++ b/package/netopeer2-server/netopeer2-server.hash @@ -0,0 +1 @@ +../netopeer2-keystored/netopeer2-keystored.hash \ No newline at end of file diff --git a/package/netopeer2-server/netopeer2-server.mk b/package/netopeer2-server/netopeer2-server.mk new file mode 100644 index 0000000000..449c2082d3 --- /dev/null +++ b/package/netopeer2-server/netopeer2-server.mk @@ -0,0 +1,33 @@ +################################################################################ +# +# netopeer2-server +# +################################################################################ + +NETOPEER2_SERVER_VERSION = 0.7-r2 +NETOPEER2_SERVER_SOURCE = netopeer2-$(NETOPEER2_SERVER_VERSION).tar.gz +NETOPEER2_SERVER_SITE = $(call github,CESNET,Netopeer2,v$(NETOPEER2_SERVER_VERSION)) +NETOPEER2_SERVER_DL_SUBDIR = netopeer2 +NETOPEER2_SERVER_LICENSE = BSD-3-Clause +NETOPEER2_SERVER_LICENSE_FILES = LICENSE +NETOPEER2_SERVER_SUBDIR = server +NETOPEER2_SERVER_DEPENDENCIES = libyang sysrepo + +NETOPEER2_SERVER_CONF_OPTS = \ + -DENABLE_CONFIGURATION=ON \ + -DKEYSTORED_KEYS_DIR=/etc/keystored/keys + +define NETOPEER2_SERVER_INSTALL_INIT_SYSV + $(INSTALL) -m 755 -D package/netopeer2-server/S52netopeer2-server \ + $(TARGET_DIR)/etc/init.d/S52netopeer2-server +endef + +define NETOPEER2_SERVER_PERMISSIONS + /etc/sysrepo/data/ietf-netconf-server.persist f 600 0 0 - - - - - + /etc/sysrepo/data/ietf-netconf-server.running f 600 0 0 - - - - - + /etc/sysrepo/data/ietf-netconf-server.running.lock f 600 0 0 - - - - - + /etc/sysrepo/data/ietf-netconf-server.startup f 600 0 0 - - - - - + /etc/sysrepo/data/ietf-netconf-server.startup.lock f 600 0 0 - - - - - +endef + +$(eval $(cmake-package)) From patchwork Mon Oct 28 09:03:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1185262 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.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="K5urZ8zC"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 471pgq0FrKz9sPT for ; Mon, 28 Oct 2019 20:04:39 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D92258353B; Mon, 28 Oct 2019 09:04:36 +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 2MJz30vuzqko; Mon, 28 Oct 2019 09:04:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 180D78354B; Mon, 28 Oct 2019 09:04:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id B58191BF284 for ; Mon, 28 Oct 2019 09:04:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B224C20397 for ; Mon, 28 Oct 2019 09:04:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aG94I6MCxwUi for ; Mon, 28 Oct 2019 09:04:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by silver.osuosl.org (Postfix) with ESMTPS id 5CA4220365 for ; Mon, 28 Oct 2019 09:04:28 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id r141so8196422wme.4 for ; Mon, 28 Oct 2019 02:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rGsk934yZZQC4IXeIX0umyHJKYlcTrO+UTtzVMJCaxM=; b=K5urZ8zCb9ka2p3dD96W81itaaDmg13lOLDkCDaO7zn4MfbMe5qdbJ4x0/AXvPUK4g 3ZnFlU1wbzSDH0dNe65lvgEQNmkmVQ99INU3yHLL6fj18dTkQZ7nz+PqmcQK0B+QNW+L r9vjMIy82X0Ryf6uA8FaHhs+EJy9oUHOttboGXGyu3OPCmVAi62nx4YB8K6nnAnbBX27 7kHMwQZOmNqutU6us+OPnVqe4cwFWqry1/D98uRIS5hEop/S2E2qCBorU+vE7KwkFyB1 YnKpEzId46lkXCJzzQOXVVldUWGjQ4qinPFRe2I4KntotX4HuEbCuKNoz/qoj1a7v5w0 ZDCA== 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=rGsk934yZZQC4IXeIX0umyHJKYlcTrO+UTtzVMJCaxM=; b=NIVIUOeX+Ry6RWxvjidO4iQspgYsLdHmzNCUnLqfkZM8Oq8RXl2fduFihOMCsZs3lL iMIdFnDHyVfz1XakwCp29sb8epm8dn7vIVr5Pi7Jx/2Lpain+tzGjnibP9gDyQj7lcub vQyFkeWr42RpYKxdh5xgUOuWnJsH6x+FYuVUijtidDq0vClD6hKPl8w7yShUd2HpYs4d Sdjwfs0/ipC/mEC4A/d3ru5ck0jg85wv/A0KTAYOrqpjK1qzv//h+yaC+RISNwX3OK2h vqekIXbq+KITCnpOxAmBCHqHX/hU3icUkY3A3pdg98jRIh7dmUKrZayQHP3Efckpa3CM eLUQ== X-Gm-Message-State: APjAAAVlV/9cL/gwdUW/ccgHYpTZnComrYS9SFzQBlmY5SKKk0zVtn5K 3ibnVjCMdKXMTs/oKF7SjVCk8193 X-Google-Smtp-Source: APXvYqwhBapRs8uFTZpqw+EbKFQJ+ETz15mRgi7Uft/sM3hkA0b0Qw6f3UsWHYlFBEFHcYm2TAB3jQ== X-Received: by 2002:a1c:7ec2:: with SMTP id z185mr13972069wmc.69.1572253466531; Mon, 28 Oct 2019 02:04:26 -0700 (PDT) Received: from hthiery01.sab.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id 26sm10344909wmi.17.2019.10.28.02.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 02:04:25 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Mon, 28 Oct 2019 10:03:29 +0100 Message-Id: <20191028090329.25432-6-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191028090329.25432-1-heiko.thiery@gmail.com> References: <20191028090329.25432-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 5/5] package/netopeer2-cli: add 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: Heiko Thiery , Heiko Thiery , thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Heiko Thiery netopeer2 CLI - simple command line interface to connect to a NETCONF server (device). Signed-off-by: Heiko Thiery --- DEVELOPERS | 1 + package/Config.in | 1 + package/netopeer2-cli/Config.in | 21 +++++++++++++++++++++ package/netopeer2-cli/netopeer2-cli.hash | 1 + package/netopeer2-cli/netopeer2-cli.mk | 17 +++++++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 package/netopeer2-cli/Config.in create mode 120000 package/netopeer2-cli/netopeer2-cli.hash create mode 100644 package/netopeer2-cli/netopeer2-cli.mk diff --git a/DEVELOPERS b/DEVELOPERS index 217d044930..d70985393b 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1048,6 +1048,7 @@ F: package/python-sip/ N: Heiko Thiery F: package/libnetconf2/ F: package/libyang/ +F: package/netopeer2-cli/ F: package/netopeer2-keystored/ F: package/netopeer2-server/ F: package/sysrepo/ diff --git a/package/Config.in b/package/Config.in index aaecef433f..3048ecd8ed 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1659,6 +1659,7 @@ menu "Networking" source "package/mongoose/Config.in" source "package/nanomsg/Config.in" source "package/neon/Config.in" + source "package/netopeer2-cli/Config.in" source "package/netopeer2-keystored/Config.in" source "package/netopeer2-server/Config.in" source "package/nghttp2/Config.in" diff --git a/package/netopeer2-cli/Config.in b/package/netopeer2-cli/Config.in new file mode 100644 index 0000000000..9c3a302a1d --- /dev/null +++ b/package/netopeer2-cli/Config.in @@ -0,0 +1,21 @@ +config BR2_PACKAGE_NETOPEER2_CLI + bool "netopeer2-cli" + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_STATIC_LIBS + select BR2_PACKAGE_LIBYANG + select BR2_PACKAGE_LIBNETCONF2 + select BR2_PACKAGE_LIBSSH + select BR2_PACKAGE_LIBSSH_SERVER + select BR2_PACKAGE_PCRE # libyang + select BR2_PACKAGE_PCRE_UCP # libyang + select BR2_PACKAGE_SYSREPO + help + Netopeer2 is a set of tools implementing network + configuration tools based on the NETCONF Protocol. + + This is the CLI client part. + + https://github.com/CESNET/Netopeer2 + +comment "netopeer2cli needs a toolchain w/ threads, dynamic libraray" + depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/netopeer2-cli/netopeer2-cli.hash b/package/netopeer2-cli/netopeer2-cli.hash new file mode 120000 index 0000000000..47bb47d7e3 --- /dev/null +++ b/package/netopeer2-cli/netopeer2-cli.hash @@ -0,0 +1 @@ +../netopeer2-keystored/netopeer2-keystored.hash \ No newline at end of file diff --git a/package/netopeer2-cli/netopeer2-cli.mk b/package/netopeer2-cli/netopeer2-cli.mk new file mode 100644 index 0000000000..9adc8226de --- /dev/null +++ b/package/netopeer2-cli/netopeer2-cli.mk @@ -0,0 +1,17 @@ +################################################################################ +# +# netopeer2-cli +# +################################################################################ + +NETOPEER2_CLI_VERSION = 0.7-r2 +NETOPEER2_CLI_SOURCE = netopeer2-$(NETOPEER2_CLI_VERSION).tar.gz +NETOPEER2_CLI_SITE = $(call github,CESNET,Netopeer2,v$(NETOPEER2_CLI_VERSION)) +NETOPEER2_CLI_DL_SUBDIR = netopeer2 +NETOPEER2_CLI_LICENSE = BSD-3-Clause +NETOPEER2_CLI_LICENSE_FILES = LICENSE +NETOPEER2_CLI_SUBDIR = cli +NETOPEER2_CLI_INSTALL_STAGING = YES +NETOPEER2_CLI_DEPENDENCIES = libnetconf2 libyang sysrepo + +$(eval $(cmake-package))