Skip to contentSkip to conversation

add frr package

PATCH Superseded Vadim Kochan 3 participants 11 messages Feb 25, 2020

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover add frr package

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)

FRR package requires LYD_PRIV option to be enabled in libyang package, so enabled it in separate patch if frr is selected.

Disabled some options for frr package like:

- POSIX capabilities
- RPKi

v2:
1) fixed TAB indent on multiline var assignment

2) fixed ABC ordering

3) add missing 'depends on' from selected libs by frr

4) directly call /usr/sbin/frrinit.sh S50frr init script w/o start-stop-daemon tool, frr cares of daemons stopping/ running.

5) Removed not-needed empty daemons *.conf files installation, it was taken from building instructions in frr docs, but really it is not required.

6) Use 0644 mask for conf files.

7) Enable LYD_PRIV option for libyang only if frr selected.

8) Drop patch with rtrlib package which is needed only for RPKi support which is disabled by default.

9) Add AUTORECONF for bootstrap invocation.

10) Get rid of manual binaries target invocation. After frr.mk cleanup it starts to work.

11) Install var/log/frr and /var/run/frr at runtime from init.

Vadim Kochan (2):
package/libyang: enable LYD_PRIV option for frr package package/frr: new package

 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 ++++++++++++++++++++++++++++++++++++++
 package/libyang/libyang.mk |  4 ++
 7 files changed, 154 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
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/2 package/libyang: enable LYD_PRIV option for frr package

This option is required by frr package, so enable it only if frr is selected.

---
 package/libyang/libyang.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/libyang/libyang.mk +4 -0
index 648ffeb6a3..9d7f5df696 100644
@@ -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
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 1/2 package/libyang: enable LYD_PRIV option for frr package

Quoted 13 lines · On Tue, 25 Feb 2020 04:58:49 +0200 Vadim Kochan <[email protected]> wrote:

This option is required by frr package, so enable it only if frr is selected.

---
 package/libyang/libyang.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/libyang/libyang.mk +0 -0
index 648ffeb6a3..9d7f5df696 100644

package/libyang/libyang.mk LIBYANG_CONF_OPTS = \ · line 20

Quoted 4 lines
package/libyang/libyang.mk +1 -0
@@ -17,6 +17,10 @@ LIBYANG_CONF_OPTS = \
 	-DENABLE_VALGRIND_TESTS=OFF \
 	-DGEN_PYTHON_BINDINGS=OFF
 
+ifeq ($(BR2_PACKAGE_FRR),y)

We normally don't look at which reverse dependencies are enabled to enable features in a dependent package. We do the opposite: look at which of our dependencies are available to enable features.

What is the size increase of enabling this option? If it is significant, we want to introduce a BR2_PACKAGE_LIBYANG_LYD_PRIV sub-option, and select it from the frr package.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v2 2/2 package/frr: new package

In reply to Vadim Kochan

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

---
 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
DEVELOPERS +1 -0
index 7d3d1ca11a..95ea2254de 100644
@@ -2477,6 +2477,7 @@ F:	package/tstools/
 
 N:	Vadim Kochan <[email protected]>
 F:	package/brcm-patchram-plus/
+F:	package/frr/
 F:	package/gettext-tiny/
 F:	package/tinyssh/
 
package/Config.in +1 -0
index dfa3f34b9d..3e6b51a745 100644
@@ -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"
package/frr/Config.in new file +25 -0
new file mode 100644
index 0000000000..c0c3bdd693
@@ -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
package/frr/S50frr new file +46 -0

46 lines not on this page · raw message

package/frr/frr.hash new file +2 -0
new file mode 100644
index 0000000000..7d9ff7ea04
@@ -0,0 +1,2 @@
+sha256 c209ed66a0331221649b8c21dc8c6704ce1696e2017ef4d48f8c2ac6b1fa01b7  frr-7.3.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
package/frr/frr.mk new file +75 -0

75 lines not on this page · raw message

Signature · 1 line
2.17.1
#4 lore raw

PATCH v2 2/2 package/frr: new package

Hi Vadim and all,

Am Di., 25. Feb. 2020 um 03:59 Uhr schrieb Vadim Kochan <[email protected]>:

Quoted 43 lines

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

---
 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

[SNIP]

Quoted 6 lines
package/frr/frr.mk new file +0 -0
new file mode 100644
index 0000000000..448aa56690

package/frr/frr.mk line 8

Quoted 8 lines
package/frr/frr.mk new file +8 -0
@@ -0,0 +1,75 @@
+################################################################################
+#
+# frr
+#
+################################################################################
+
+FRR_VERSION = 7.3
+FRR_SOURCE = frr-$(FRR_VERSION).tar.gz

You can remove FRR_SOURCE because it is not needed. Buildroot will automatically set this to "frr-$(FRR_VERSION).tar.gz".

Quoted 23 lines
package/frr/frr.mk new file +23 -0
+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 \

package/frr/frr.mk line 41

Quoted 10 lines
package/frr/frr.mk new file +10 -0
+       --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

Do we realy need to call the bootstrap.sh? The only thing done here is to call "autoreconf -i". This is automatically called by buildroot when setting "FRR_AUTORECONF = YES".

@@ -34,12 +33,6 @@ FRR_CONF_OPTS = --with-clippy=$(HOST_DIR)/bin/clippy \

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

Quoted 35 lines
package/frr/frr.mk new file +34 -1
+
+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))
--
Quoted 2 lines

2.17.1

Also some warnings from "utils/check-package package/frr/*":

package/frr/Config.in:16: help text: <tab><2 spaces><62 chars>
(http://nightly.buildroot.org/#writing-rules-config-in)
package/frr/frr.mk:8: remove default value of _SOURCE variable
(http://nightly.buildroot.org/#generic-package-reference)
102 lines processed
2 warnings generated

BR
--
Heiko

#5 lore raw

PATCH v2 2/2 package/frr: new package

Quoted 111 lines · Heiko Thiery

Hi Vadim and all,

Am Di., 25. Feb. 2020 um 03:59 Uhr schrieb Vadim Kochan <[email protected]>:

Quoted 43 lines

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

---
 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

[SNIP]

Quoted 6 lines
package/frr/frr.mk new file +0 -0
new file mode 100644
index 0000000000..448aa56690

package/frr/frr.mk line 8

Quoted 8 lines
package/frr/frr.mk new file +8 -0
@@ -0,0 +1,75 @@
+################################################################################
+#
+# frr
+#
+################################################################################
+
+FRR_VERSION = 7.3
+FRR_SOURCE = frr-$(FRR_VERSION).tar.gz

You can remove FRR_SOURCE because it is not needed. Buildroot will automatically set this to "frr-$(FRR_VERSION).tar.gz".

Quoted 23 lines
package/frr/frr.mk new file +23 -0
+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 \

package/frr/frr.mk line 41

Quoted 10 lines
package/frr/frr.mk new file +10 -0
+       --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

Do we realy need to call the bootstrap.sh? The only thing done here is to call "autoreconf -i". This is automatically called by buildroot when setting "FRR_AUTORECONF = YES".

(quoted diff) +0 -0
@@ -34,12 +33,6 @@ FRR_CONF_OPTS = --with-clippy=$(HOST_DIR)/bin/clippy \
 
 HOST_FRR_CONF_OPTS = --enable-clippy-only

Review FRR_CONF_OPTS = --with-clippy=$(HOST_DIR)/bin/clippy \ · line 38

Quoted 10 lines
(quoted diff) +0 -6
 
-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

[SNIP]
...
Thanks! all your suggestions works!
...
[SNIP]

Quoted 19 lines
Quoted 6 lines
package/frr/frr.mk new file +3 -1
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
--

2.17.1

Also some warnings from "utils/check-package package/frr/*":

package/frr/Config.in:16: help text: <tab><2 spaces><62 chars>
(http://nightly.buildroot.org/#writing-rules-config-in)
package/frr/frr.mk:8: remove default value of _SOURCE variable
(http://nightly.buildroot.org/#generic-package-reference)
102 lines processed
2 warnings generated

BR
--
Heiko

#6 lore raw

PATCH v2 2/2 package/frr: new package

In reply to Vadim Kochan

Hi Vadim and all,

Am Di., 25. Feb. 2020 um 03:59 Uhr schrieb Vadim Kochan <[email protected]>:

Quoted 31 lines

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

---

[SNIP]

Quoted 82 lines
package/frr/frr.mk new file +75 -1
new file mode 100644
index 0000000000..448aa56690
@@ -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))
--
Quoted 2 lines

2.17.1

I see that thei install step installs examples in a directory where (I think) it never should install stuff! It is the targetno directory.

/usr/bin/install -c -m 644 zebra/zebra.conf.sample
bgpd/bgpd.conf.sample bgpd/bgpd.conf.sample2 bgpd/bgpd.conf.vnc.sample ripd/ripd.conf.sample ripngd/ripngd.conf.sample ospfd/ospfd.conf.sample ospf6d/ospf6d.conf.sample isisd/isisd.conf.sample isisd/fabricd.conf.sample ldpd/ldpd.conf.sample babeld/babeld.conf.sample eigrpd/eigrpd.conf.sample pimd/pimd.conf.sample pbrd/pbrd.conf.sample staticd/staticd.conf.sample bfdd/bfdd.conf.sample vtysh/vtysh.conf.sample '/home/hthiery/sources/mainline/buildroot/output/targetno'

I cannot see how it is possible to properly disable the install of examples. I see that you already have set the option --disable-exampledir. But this seems not to be enought, or it is broken.

--
Heiko

#7 lore raw

PATCH v2 2/2 package/frr: new package

Hi Heiko,

Quoted 138 lines · Heiko Thiery

Hi Vadim and all,

Am Di., 25. Feb. 2020 um 03:59 Uhr schrieb Vadim Kochan <[email protected]>:

Quoted 31 lines

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

---

[SNIP]

Quoted 82 lines
package/frr/frr.mk new file +75 -1
new file mode 100644
index 0000000000..448aa56690
@@ -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))
--
Quoted 2 lines

2.17.1

I see that thei install step installs examples in a directory where (I think) it never should install stuff! It is the targetno directory.

/usr/bin/install -c -m 644 zebra/zebra.conf.sample
bgpd/bgpd.conf.sample bgpd/bgpd.conf.sample2 bgpd/bgpd.conf.vnc.sample ripd/ripd.conf.sample ripngd/ripngd.conf.sample ospfd/ospfd.conf.sample ospf6d/ospf6d.conf.sample isisd/isisd.conf.sample isisd/fabricd.conf.sample ldpd/ldpd.conf.sample babeld/babeld.conf.sample eigrpd/eigrpd.conf.sample pimd/pimd.conf.sample pbrd/pbrd.conf.sample staticd/staticd.conf.sample bfdd/bfdd.conf.sample vtysh/vtysh.conf.sample '/home/hthiery/sources/mainline/buildroot/output/targetno'

Quoted 4 lines

I cannot see how it is possible to properly disable the install of examples. I see that you already have set the option --disable-exampledir. But this seems not to be enought, or it is broken.

Wow! Nice catch, I did not realize this, so there are like at least 2 options ?
1) remove it in hook
2) patch the frr build scripts (which looks like more safer?)

#8 lore raw

PATCH v2 2/2 package/frr: new package

Hi Vadim and all,

Quoted 16 lines
Quoted 16 lines

I see that thei install step installs examples in a directory where (I think) it never should install stuff! It is the targetno directory.

/usr/bin/install -c -m 644 zebra/zebra.conf.sample
bgpd/bgpd.conf.sample bgpd/bgpd.conf.sample2 bgpd/bgpd.conf.vnc.sample ripd/ripd.conf.sample ripngd/ripngd.conf.sample ospfd/ospfd.conf.sample ospf6d/ospf6d.conf.sample isisd/isisd.conf.sample isisd/fabricd.conf.sample ldpd/ldpd.conf.sample babeld/babeld.conf.sample eigrpd/eigrpd.conf.sample pimd/pimd.conf.sample pbrd/pbrd.conf.sample staticd/staticd.conf.sample bfdd/bfdd.conf.sample vtysh/vtysh.conf.sample '/home/hthiery/sources/mainline/buildroot/output/targetno'

Quoted 8 lines
Quoted 4 lines

I cannot see how it is possible to properly disable the install of examples. I see that you already have set the option --disable-exampledir. But this seems not to be enought, or it is broken.

Wow! Nice catch, I did not realize this, so there are like at least 2 options ?
1) remove it in hook
2) patch the frr build scripts (which looks like more safer?)

I think reporting that upstream and patching would be the best solution.

--
Heiko

#9 lore raw

PATCH v2 2/2 package/frr: new package

Quoted 24 lines · Heiko Thiery

Hi Vadim and all,

Quoted 21 lines
Quoted 20 lines

I see that thei install step installs examples in a directory where (I think) it never should install stuff! It is the targetno directory.

/usr/bin/install -c -m 644 zebra/zebra.conf.sample
bgpd/bgpd.conf.sample bgpd/bgpd.conf.sample2 bgpd/bgpd.conf.vnc.sample ripd/ripd.conf.sample ripngd/ripngd.conf.sample ospfd/ospfd.conf.sample ospf6d/ospf6d.conf.sample isisd/isisd.conf.sample isisd/fabricd.conf.sample ldpd/ldpd.conf.sample babeld/babeld.conf.sample eigrpd/eigrpd.conf.sample pimd/pimd.conf.sample pbrd/pbrd.conf.sample staticd/staticd.conf.sample bfdd/bfdd.conf.sample vtysh/vtysh.conf.sample '/home/hthiery/sources/mainline/buildroot/output/targetno'

I cannot see how it is possible to properly disable the install of examples. I see that you already have set the option --disable-exampledir. But this seems not to be enought, or it is broken.

Quoted 6 lines
Quoted 3 lines

Wow! Nice catch, I did not realize this, so there are like at least 2 options ?
1) remove it in hook
2) patch the frr build scripts (which looks like more safer?)

I think reporting that upstream and patching would be the best solution.

Hm, problem is that this --enable-exampledir is used as bool option to specify alternative path for installing config samples, and because I set it to "--disable-exampledir"
then this value is set to "no" and eventually is appended to DESTDIR which is $(TARGET_DIR),
which is evaluated to .../targetno.

But is this a problem if config samples will be installed to $(TARGET_DIR)/etc/frr (which is default
if to remove --disable-exampledir) ?

#10 lore raw

PATCH v2 2/2 package/frr: new package

Quoted 39 lines · Vadim Kochan
Quoted 24 lines · Heiko Thiery

Hi Vadim and all,

Quoted 21 lines
Quoted 20 lines

I see that thei install step installs examples in a directory where (I think) it never should install stuff! It is the targetno directory.

/usr/bin/install -c -m 644 zebra/zebra.conf.sample
bgpd/bgpd.conf.sample bgpd/bgpd.conf.sample2 bgpd/bgpd.conf.vnc.sample ripd/ripd.conf.sample ripngd/ripngd.conf.sample ospfd/ospfd.conf.sample ospf6d/ospf6d.conf.sample isisd/isisd.conf.sample isisd/fabricd.conf.sample ldpd/ldpd.conf.sample babeld/babeld.conf.sample eigrpd/eigrpd.conf.sample pimd/pimd.conf.sample pbrd/pbrd.conf.sample staticd/staticd.conf.sample bfdd/bfdd.conf.sample vtysh/vtysh.conf.sample '/home/hthiery/sources/mainline/buildroot/output/targetno'

I cannot see how it is possible to properly disable the install of examples. I see that you already have set the option --disable-exampledir. But this seems not to be enought, or it is broken.

Quoted 6 lines
Quoted 3 lines

Wow! Nice catch, I did not realize this, so there are like at least 2 options ?
1) remove it in hook
2) patch the frr build scripts (which looks like more safer?)

I think reporting that upstream and patching would be the best solution.

Hm, problem is that this --enable-exampledir is used as bool option to specify alternative path for installing config samples, and because I set it to "--disable-exampledir"
then this value is set to "no" and eventually is appended to DESTDIR which is $(TARGET_DIR),
which is evaluated to .../targetno.

Quoted 3 lines

But is this a problem if config samples will be installed to $(TARGET_DIR)/etc/frr (which is default
if to remove --disable-exampledir) ?

Actually I can remove them in POST_INSTALL hook )