From patchwork Tue Feb 25 02:58:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1243812 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.a=rsa-sha256 header.s=20161025 header.b=OC3E929B; 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 48RNts5q4hz9sQt for ; Tue, 25 Feb 2020 13:59:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2E06985F41; Tue, 25 Feb 2020 02:59:16 +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 yGDn8w3dtnTu; Tue, 25 Feb 2020 02:59:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id AF858868C0; Tue, 25 Feb 2020 02:59:15 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 505BB1BF271 for ; Tue, 25 Feb 2020 02:59:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 4D36B8790F for ; Tue, 25 Feb 2020 02:59:12 +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 b1kueQ9NMFGS for ; Tue, 25 Feb 2020 02:59:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by hemlock.osuosl.org (Postfix) with ESMTPS id C488D878ED for ; Tue, 25 Feb 2020 02:59:10 +0000 (UTC) Received: by mail-lj1-f182.google.com with SMTP id d10so12336105ljl.9 for ; Mon, 24 Feb 2020 18:59:10 -0800 (PST) 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; bh=rq+Wuuy8nRirT3oavU7kzMxN0zHMoxW8C7INJzhyWFY=; b=OC3E929BTCIJOYT/bm9WFXYMDtEC88g1kmLmLlmRF6rpeg0VaOPdIHk6ZZ/R9B6NMf dIXFsPMM8ewIwv+WIG4nWOx/Q+UiN+vA4hJiVe55ShLMCJTFikx+ANa0AMWCl8omE5l6 OSbtNCfQuAyEOZcHN+UysSB5EyOcPj9bV9nnfeo+PQ9mZiPzwwny/xriQS+LCSinbLRv joT+7YGTEs03NnSecGjYE4ij6v8aLiM0icT8D2+P3AXkjNHmzeCpkrL1Xj3JMq4q+hpz Bp3avnTcKf/EGMnv7Tc3JDaEnM042rerao4MISBEL/B6UeVXI2IasGo5MZZi6zGJN4GI KjEQ== 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; bh=rq+Wuuy8nRirT3oavU7kzMxN0zHMoxW8C7INJzhyWFY=; b=cSWHx2qaqnlyHdVQCELRsZGeKIjYKPZzTMbRUnDtczby9KyzFVgU0YZj7qk/dpDoHg NXSZ0n340pXbCiZB1uAeO/P0FTWQb31m3nrzysYz3VtHIK0uun1opISCO2dVTYGnCcsU A6LqKjUrqVLxDdKUNVXTctsrU4fLnJeCGUDN79lYpI9xPftXckOZ+kIZJajpGuSYW/Jp KhB4Ep+ZMBa9pxVZfvkNhKSL2GFF159WVS0erVCBMvgOrimkWScRml3FG/qwpDeDHcWu N7Rxx74nHRAlq2LMiL8MrJU/RlPZYVAcbnKb4mmT01xH/e2pkUS8VOJFzpz7z+IqvWRz qK2g== X-Gm-Message-State: APjAAAXJYbInJENV2DPKHR53gWgdB6S1oXiqZG5eEqeWenZs1j7v4xeY 3bELbwUKZHxKuKKQdvsNC8pSHZgS X-Google-Smtp-Source: APXvYqyzQRUdfHuF/G5tBlnjVqCObARvTgL9sZRJL/XsFnQQVwJSXdFppRMD8sM5+jrYcg/b9I1z0Q== X-Received: by 2002:a2e:6a19:: with SMTP id f25mr33649436ljc.27.1582599548562; Mon, 24 Feb 2020 18:59:08 -0800 (PST) Received: from pc60716vkochan.x.ow.s ([217.20.186.93]) by smtp.gmail.com with ESMTPSA id d26sm6458569lfa.44.2020.02.24.18.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 18:59:07 -0800 (PST) From: Vadim Kochan To: buildroot@buildroot.org Date: Tue, 25 Feb 2020 04:58:49 +0200 Message-Id: <20200225025850.17209-2-vadim4j@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200225025850.17209-1-vadim4j@gmail.com> References: <20200225025850.17209-1-vadim4j@gmail.com> Subject: [Buildroot] [PATCH v2 1/2] package/libyang: enable LYD_PRIV option for frr 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 , Vadim Kochan , Jan Kundrat MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This option is required by frr package, so enable it only if frr is selected. Signed-off-by: Vadim Kochan --- package/libyang/libyang.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/libyang/libyang.mk b/package/libyang/libyang.mk index 648ffeb6a3..9d7f5df696 100644 --- a/package/libyang/libyang.mk +++ b/package/libyang/libyang.mk @@ -17,6 +17,10 @@ LIBYANG_CONF_OPTS = \ -DENABLE_VALGRIND_TESTS=OFF \ -DGEN_PYTHON_BINDINGS=OFF +ifeq ($(BR2_PACKAGE_FRR),y) +LIBYANG_CONF_OPTS += -DENABLE_LYD_PRIV=ON +endif + HOST_LIBYANG_CONF_OPTS = \ -DENABLE_VALGRIND_TESTS=OFF \ -DGEN_PYTHON_BINDINGS=OFF From patchwork Tue Feb 25 02:58:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1243814 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.a=rsa-sha256 header.s=20161025 header.b=huJ35uM+; 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 48RNtz0HWPz9sPK for ; Tue, 25 Feb 2020 13:59:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B90CD86AAA; Tue, 25 Feb 2020 02:59:20 +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 M3acs_UeuFN9; Tue, 25 Feb 2020 02:59:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9580386A99; Tue, 25 Feb 2020 02:59:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 39C101BF271 for ; Tue, 25 Feb 2020 02:59:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 36ADA878ED for ; Tue, 25 Feb 2020 02:59:13 +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 DPtPEOHniBer for ; Tue, 25 Feb 2020 02:59:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by hemlock.osuosl.org (Postfix) with ESMTPS id 2923B8790D for ; Tue, 25 Feb 2020 02:59:12 +0000 (UTC) Received: by mail-lf1-f52.google.com with SMTP id 7so8442456lfz.11 for ; Mon, 24 Feb 2020 18:59:12 -0800 (PST) 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; bh=CgZxRY63f12YEtBtnVMVx59DjEei3Wc5zSU943Mmokg=; b=huJ35uM+6rJmRpn7SBMFbH2GiUTgAMAZL7XA4697FFRfHZF2jbet3IrNachJNm53hK oz4RrruKyrRqvbHlOvq553oCIqKQMgIltjttkiWiXWLUFy4O2ll/vrCBuqGvVr93WVCn 0hux24IfxrMfmCrlBWcxfrhcRJnOoZjW7XBU1poZHh7srvdn2vQMrPpM4e0fZX2SLanO BHYXRwt83s2ojOKE2Q3er3ZRwv80XwTUyGbCtBrw5s26wnBiQHOLBa0oUbwSyi1ihBAO qWiwN0zBRfkDQNjQr3S16sY9awCBkKzk2doPzVLTqo4FFym/z3dzAKv5Bb8g8A0jO/xK jdDw== 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; bh=CgZxRY63f12YEtBtnVMVx59DjEei3Wc5zSU943Mmokg=; b=o/Lf0/HD8Bsle570XNYyDbASL40hXf8n5j6D19wySAzRLLmKjt8ywTkCwiFsiLng7T yHpxIOxnxgjMQpcQw0IyuPqqoovVz3pvTqdiZ5SYbd/1bJAsXwliyDFfjKP1JOm2iLOI SCS+2AWXzzWWgYy3JurZn9SHfz2oKs+O69iLtictmwxr+EKeB3MuvDO+eZb8TzwlbdjV +QOtlLxrUlurklj+Yzzpej1rXSMt7KO0aYz1CaXuWkt5P5OseFx2HqJZKJvv8eq82UIa oa16IxXmGdIn8ZXO+keWiAf3lg2yPpWHZT1n065d3IOH66p/P3Zi9x78UaVoBjXqIHVe AyPw== X-Gm-Message-State: APjAAAV2/uvHaKQn8FOKD4Db6kp7CV6m8qzliLw8BdU5FJUgT58/gU52 6kmwp/knRb26WGAlhhtXCwT+Nene X-Google-Smtp-Source: APXvYqwvIozU3olItnrKp7Tz48lkc5Bj1dLWHDLMLVczsAbcr6ZBAmWSIVeOoRi7uf09pK5JB1TRuA== X-Received: by 2002:a19:6d13:: with SMTP id i19mr28118197lfc.6.1582599549591; Mon, 24 Feb 2020 18:59:09 -0800 (PST) Received: from pc60716vkochan.x.ow.s ([217.20.186.93]) by smtp.gmail.com with ESMTPSA id d26sm6458569lfa.44.2020.02.24.18.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 18:59:09 -0800 (PST) From: Vadim Kochan To: buildroot@buildroot.org Date: Tue, 25 Feb 2020 04:58:50 +0200 Message-Id: <20200225025850.17209-3-vadim4j@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200225025850.17209-1-vadim4j@gmail.com> References: <20200225025850.17209-1-vadim4j@gmail.com> Subject: [Buildroot] [PATCH v2 2/2] package/frr: 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: Heiko Thiery , Vadim Kochan , Jan Kundrat MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" FRR is free software that implements and manages various IPv4 and IPv6 routing protocols. It runs on nearly all distributions of Linux and BSD as well as Solaris and supports all modern CPU architectures. FRR currently supports the following protocols: BGP OSPFv2 OSPFv3 RIPv1 RIPv2 RIPng IS-IS PIM-SM/MSDP LDP BFD Babel PBR OpenFabric VRRP EIGRP (alpha) NHRP (alpha) Some not-needed features were disabled to minimize package dependencies: - POSIX capabilities - RPKi Signed-off-by: Vadim Kochan --- DEVELOPERS | 1 + package/Config.in | 1 + package/frr/Config.in | 25 +++++++++++++++ package/frr/S50frr | 46 ++++++++++++++++++++++++++ package/frr/frr.hash | 2 ++ package/frr/frr.mk | 75 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 150 insertions(+) create mode 100644 package/frr/Config.in create mode 100644 package/frr/S50frr create mode 100644 package/frr/frr.hash create mode 100644 package/frr/frr.mk diff --git a/DEVELOPERS b/DEVELOPERS index 7d3d1ca11a..95ea2254de 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2477,6 +2477,7 @@ F: package/tstools/ N: Vadim Kochan F: package/brcm-patchram-plus/ +F: package/frr/ F: package/gettext-tiny/ F: package/tinyssh/ diff --git a/package/Config.in b/package/Config.in index dfa3f34b9d..3e6b51a745 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1998,6 +1998,7 @@ menu "Networking applications" source "package/fping/Config.in" source "package/freeswitch/Config.in" source "package/freeswitch-mod-bcg729/Config.in" + source "package/frr/Config.in" source "package/gerbera/Config.in" source "package/gesftpserver/Config.in" source "package/glorytun/Config.in" diff --git a/package/frr/Config.in b/package/frr/Config.in new file mode 100644 index 0000000000..c0c3bdd693 --- /dev/null +++ b/package/frr/Config.in @@ -0,0 +1,25 @@ +config BR2_PACKAGE_FRR + bool "frr" + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_STATIC_LIBS # libyang + depends on BR2_USE_MMU # fork() + depends on BR2_PACKAGE_BASH # init + depends on BR2_TOOLCHAIN_HAS_SYNC_4 # json-c + select BR2_PACKAGE_C_ARES + select BR2_PACKAGE_LIBYANG + select BR2_PACKAGE_LIBNL + select BR2_PACKAGE_READLINE + select BR2_PACKAGE_JSON_C + help + The FRRouting Protocol Suite. + + FRR is free software that implements and manages various IPv4 and + IPv6 routing protocols. + + https://frrouting.org + +comment "frr needs BASH, threads, dynamic library" + depends on BR2_TOOLCHAIN_HAS_SYNC_4 + depends on BR2_USE_MMU + depends on !BR2_PACKAGE_BASH || !BR2_TOOLCHAIN_HAS_THREADS || \ + BR2_STATIC_LIBS diff --git a/package/frr/S50frr b/package/frr/S50frr new file mode 100644 index 0000000000..0c128353e9 --- /dev/null +++ b/package/frr/S50frr @@ -0,0 +1,46 @@ +#!/bin/sh + +DAEMON="frr" + +[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" + +start() { + install -m 755 -o frr -g frr -d /var/run/frr + install -m 755 -o frr -g frr -d /var/log/frr + + printf 'Starting %s: ' "$DAEMON" + /usr/sbin/frrinit.sh start + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "$DAEMON" + /usr/sbin/frrinit.sh stop + 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/frr/frr.hash b/package/frr/frr.hash new file mode 100644 index 0000000000..7d9ff7ea04 --- /dev/null +++ b/package/frr/frr.hash @@ -0,0 +1,2 @@ +sha256 c209ed66a0331221649b8c21dc8c6704ce1696e2017ef4d48f8c2ac6b1fa01b7 frr-7.3.tar.gz +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING diff --git a/package/frr/frr.mk b/package/frr/frr.mk new file mode 100644 index 0000000000..448aa56690 --- /dev/null +++ b/package/frr/frr.mk @@ -0,0 +1,75 @@ +################################################################################ +# +# frr +# +################################################################################ + +FRR_VERSION = 7.3 +FRR_SOURCE = frr-$(FRR_VERSION).tar.gz +FRR_SITE = https://github.com/FRRouting/frr/archive +FRR_LICENSE = GPL-2.0 +FRR_LICENSE_FILES = COPYING +FRR_AUTORECONF = YES + +FRR_DEPENDENCIES = host-frr readline json-c \ + libyang libnl c-ares + +HOST_FRR_DEPENDENCIES = host-flex host-bison host-python + +FRR_CONF_OPTS = --with-clippy=$(HOST_DIR)/bin/clippy \ + --sysconfdir=/etc/frr \ + --localstatedir=/var/run/frr \ + --with-moduledir=/usr/lib/frr/modules \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-multipath=256 \ + --disable-ospfclient \ + --enable-shell-access \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --disable-exampledir \ + --disable-capabilities \ + --enable-fpm + +HOST_FRR_CONF_OPTS = --enable-clippy-only + +define FRR_RUN_BOOTSTRAP + (cd $(@D) && PATH=$(BR_PATH) ./bootstrap.sh) +endef +FRR_PRE_CONFIGURE_HOOKS += FRR_RUN_BOOTSTRAP +HOST_FRR_PRE_CONFIGURE_HOOKS += FRR_RUN_BOOTSTRAP + +define HOST_FRR_INSTALL_CMDS + $(INSTALL) -D -m 0755 $(@D)/lib/clippy $(HOST_DIR)/bin/clippy +endef + +define FRR_INSTALL_CONFIG_FILES + $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/frr + + $(foreach f,daemons daemons.conf frr.conf vtysh.conf support_bundle_commands.conf,\ + $(INSTALL) -D -m 0640 $(@D)/tools/etc/frr/$(f) \ + $(TARGET_DIR)/etc/frr/$(f) + ) +endef +FRR_POST_INSTALL_TARGET_HOOKS += FRR_INSTALL_CONFIG_FILES + +define FRR_PERMISSIONS + /etc/frr/daemons f 640 frr frr - - - - - + /etc/frr/daemons.conf f 640 frr frr - - - - - + /etc/frr/frr.conf f 640 frr frr - - - - - + /etc/frr/vtysh.conf f 640 frr frrvty - - - - - + /etc/frr/support_bundle_commands.conf f 640 frr frr +endef + +define FRR_USERS + frr -1 frr -1 * /var/run/frr - frrvty FRR user priv +endef + +define FRR_INSTALL_INIT_SYSV + $(INSTALL) -D -m 755 $(FRR_PKGDIR)/S50frr \ + $(TARGET_DIR)/etc/init.d/S50frr +endef + +$(eval $(autotools-package)) +$(eval $(host-autotools-package))