From patchwork Mon Feb 24 17:26:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1243357 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=fpmcygZQ; 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 48R8D14NmPz9sPK for ; Tue, 25 Feb 2020 04:28:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E2624863D9; Mon, 24 Feb 2020 17:28:15 +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 pu2aZts4bsWK; Mon, 24 Feb 2020 17:28:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5AA6B861D7; Mon, 24 Feb 2020 17:28:13 +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 466741BF2B1 for ; Mon, 24 Feb 2020 17:28:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 432BE85EF5 for ; Mon, 24 Feb 2020 17:28:08 +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 65glCIkji5PP for ; Mon, 24 Feb 2020 17:28:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1971185EA8 for ; Mon, 24 Feb 2020 17:28:05 +0000 (UTC) Received: by mail-lj1-f196.google.com with SMTP id o15so11034906ljg.6 for ; Mon, 24 Feb 2020 09:28:05 -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=b1PNtHNoXzu6qaUYr6v/Ir5tXFcphcnnkEXptIMSvgA=; b=fpmcygZQP2k2vUWXv+/ag5Uk9paDVsLW2ZJjqVwvqBmilujmMuhsEsRkjFecJvRYhD ckQbqUYR0XDBgjWf6T3R6xAzWDKOXfT3dKcUWW2Tah7IMRP6Q4yBLop4YQ7kRXTbujxV wo5d2xHVylHNTJ7RHxVlWIz9kNfMqOAb6uFJ6gbzhGNqItqCjx3PfKpwENGv1+59g334 fUEvTprG7ObTvFhmZc5J6UNXWKhZtFlzFKRvFzHvq/V/ctif1UipQSp9p5S9N5BAGKxQ jil9LComBcIOTQLX6k8b4P2pAuefQ/vliVP6L8p4994GwbjVTizb0htazDOz9VQgnHiN 6vLg== 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=b1PNtHNoXzu6qaUYr6v/Ir5tXFcphcnnkEXptIMSvgA=; b=XAkeTtFIM23y3jQ+4QJev8ai7phLlLOEWHIUE0mUY0n2OBPPbbw18r0QWE68KwwvAq Pzwot4J/oFtj6Q/BXN9wZdUJ51URn+HN8tSm8CGXV85KfjE+boFjVUHxUBLL1W3W/g0A tJLa37bvCitGSz3njTvb8UAB77vcqJpyGDoVR8+kD3pMjGee0KHmhP9Ro7f9rkixCaDg 7mJakZslU8XIL9122D6lmYxwuX2pSscE22LVgt51VBh4vOV0oaYe/30LjI810IickY+k hh/N9giiYUnDbn23MSi0xWcPk+h8wY00ttZq3rAvd0zDtai03sLChj0fDcLp/NzHi+Pb oxiQ== X-Gm-Message-State: APjAAAUNzbWdbLSBhh7ZZWm/HTqlXwZSVj0vz0/P8aYIFP4MtCa6YU7o NTz4DfUdOqFHhCSVcesE4RNyhgQJ X-Google-Smtp-Source: APXvYqyGjkdfdPIdsJ+P0zJ/fErkddnOrJXpEZuKmdw0y5tIHt0Dq/eFSZ4mWyaw0nDto/NSquMBOA== X-Received: by 2002:a2e:9ad0:: with SMTP id p16mr32565785ljj.111.1582565282848; Mon, 24 Feb 2020 09:28:02 -0800 (PST) Received: from pc60716vkochan.x.ow.s ([217.20.186.93]) by smtp.gmail.com with ESMTPSA id t21sm6546313ljh.14.2020.02.24.09.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 09:28:02 -0800 (PST) From: Vadim Kochan To: buildroot@buildroot.org Date: Mon, 24 Feb 2020 19:26:52 +0200 Message-Id: <20200224172652.30932-4-vadim4j@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200224172652.30932-1-vadim4j@gmail.com> References: <20200224172652.30932-1-vadim4j@gmail.com> Subject: [Buildroot] [PATCH 3/3] 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) Signed-off-by: Vadim Kochan --- DEVELOPERS | 1 + package/Config.in | 1 + package/frr/Config.in | 23 +++++++++ package/frr/S50frr | 38 +++++++++++++++ package/frr/frr.hash | 2 + package/frr/frr.mk | 105 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 170 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 e07236937b..ef6592afa0 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2480,6 +2480,7 @@ F: package/brcm-patchram-plus/ F: package/gettext-tiny/ F: package/tinyssh/ F: package/rtrlib/ +F: package/frr/ N: Valentin Korenblit F: package/clang/ diff --git a/package/Config.in b/package/Config.in index 60bf9aac10..51dc3480f4 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1999,6 +1999,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..01673eb837 --- /dev/null +++ b/package/frr/Config.in @@ -0,0 +1,23 @@ +config BR2_PACKAGE_FRR + bool "frr" + depends on BR2_USE_MMU # fork() + depends on BR2_PACKAGE_BASH # init + select BR2_PACKAGE_RTRLIB + select BR2_PACKAGE_READLINE + select BR2_PACKAGE_JSON_C + select BR2_PACKAGE_LIBYANG + select BR2_PACKAGE_LIBCAP + select BR2_PACKAGE_LIBNL + select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_NETSNMP + select BR2_PACKAGE_C_ARES + help + The FRRouting Protocol Suite. + + FRR is free software that implements and manages various IPv4 and + IPv6 routing protocols. + + https://frrouting.org + +comment "frr requires BASH for init service" + depends on !BR2_PACKAGE_BASH diff --git a/package/frr/S50frr b/package/frr/S50frr new file mode 100644 index 0000000000..dec7d82a88 --- /dev/null +++ b/package/frr/S50frr @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Starts frr. +# + +start() { + printf "Starting frr: " + start-stop-daemon -S -q -b \ + --exec /usr/sbin/frrinit.sh -- start + [ $? = 0 ] && echo "OK" || echo "FAIL" +} +stop() { + printf "Stopping frr: " + /usr/sbin/frrinit.sh stop + start-stop-daemon -K -q -p /run/frr.pid + [ $? = 0 ] && echo "OK" || echo "FAIL" +} +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? 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..c53e9bb4b0 --- /dev/null +++ b/package/frr/frr.mk @@ -0,0 +1,105 @@ +################################################################################ +# +# 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_DEPENDENCIES = rtrlib readline json-c libyang libcap libnl \ + ncurses host-frr 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 \ + --enable-rpki \ + --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 + + +# for some reason the normal 'install' target fails +FRR_INSTALL_TARGET_OPTS = DESTDIR="$(TARGET_DIR)" libdir="/usr/lib" \ + install-binPROGRAMS \ + install-sbinPROGRAMS \ + install-sbinSCRIPTS \ + installdirs + +define FRR_INSTALL_CONFIG_FILES + (cd $(@D) && PATH=$(BR_PATH) ./bootstrap.sh) + $(INSTALL) -d -m 0755 $(TARGET_DIR)/var/log/frr + $(INSTALL) -d -m 0755 $(TARGET_DIR)/var/run/frr + + $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/frr + $(INSTALL) -D -m 0644 $(@D)/tools/etc/frr/daemons $(TARGET_DIR)/etc/frr/daemons + $(INSTALL) -D -m 0644 $(@D)/tools/etc/frr/daemons.conf $(TARGET_DIR)/etc/frr/daemons.conf + $(INSTALL) -D -m 0644 $(@D)/tools/etc/frr/frr.conf $(TARGET_DIR)/etc/frr/frr.conf + $(INSTALL) -D -m 0644 $(@D)/tools/etc/frr/vtysh.conf $(TARGET_DIR)/etc/frr/vtysh.conf + $(INSTALL) -D -m 0644 $(@D)/tools/etc/frr/support_bundle_commands.conf $(TARGET_DIR)/etc/frr/support_bundle_commands.conf + + $(INSTALL) -m 0644 /dev/null $(TARGET_DIR)/etc/frr/zebra.conf + $(INSTALL) -m 0644 /dev/null $(TARGET_DIR)/etc/frr/bgpd.conf + $(INSTALL) -m 0644 /dev/null $(TARGET_DIR)/etc/frr/ospfd.conf + $(INSTALL) -m 0644 /dev/null $(TARGET_DIR)/etc/frr/ospf6d.conf + $(INSTALL) -m 0644 /dev/null $(TARGET_DIR)/etc/frr/isisd.conf + $(INSTALL) -m 0644 /dev/null $(TARGET_DIR)/etc/frr/ripd.conf + $(INSTALL) -m 0644 /dev/null $(TARGET_DIR)/etc/frr/ripngd.conf + $(INSTALL) -m 0644 /dev/null $(TARGET_DIR)/etc/frr/pimd.conf + $(INSTALL) -m 0644 /dev/null $(TARGET_DIR)/etc/frr/ldpd.conf + $(INSTALL) -m 0644 /dev/null $(TARGET_DIR)/etc/frr/nhrpd.conf +endef +FRR_POST_INSTALL_TARGET_HOOKS += FRR_INSTALL_CONFIG_FILES + +define FRR_PERMISSIONS + /var/log/frr d 755 frr frr - - - - - + /var/run/frr d 755 frr frr - - - - - + /etc/frr/zebra.conf f 644 frr frr - - - - - + /etc/frr/bgpd.conf f 644 frr frr - - - - - + /etc/frr/ospfd.conf f 644 frr frr - - - - - + /etc/frr/ospf6d.conf f 644 frr frr - - - - - + /etc/frr/isisd.conf f 644 frr frr - - - - - + /etc/frr/ripd.conf f 644 frr frr - - - - - + /etc/frr/ripngd.conf f 644 frr frr - - - - - + /etc/frr/pimd.conf f 644 frr frr - - - - - + /etc/frr/ldpd.conf f 644 frr frr - - - - - + /etc/frr/nhrpd.conf f 644 frr frr - - - - - + /etc/frr/vtysh.conf f 644 frr frrvty - - - - - +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))