Skip to content

Commit

Permalink
Dev 202111 frr options (sonic-net#12)
Browse files Browse the repository at this point in the history
* Extended build system with flags for the FRR submodule
    INCLUDE_FRR_BGP
	INCLUDE_FRR_BFD
	INCLUDE_FRR_PBR
	INCLUDE_FRR_VRRP
	INCLUDE_FRR_OSPF

* Print FRR options during the build

* Update frr.mk
  • Loading branch information
nazar-garmadiy authored and Maksym Hedeon committed Feb 1, 2023
1 parent b39288b commit a5edfb9
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 1 deletion.
7 changes: 7 additions & 0 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,10 @@ INCLUDE_SSH = y

# INCLUDE_SYNCD - build docker-syncd-$(PLATFORM)
INCLUDE_SYNCD = y

# include extended build options for FRR
INCLUDE_FRR_BGP = y
INCLUDE_FRR_BFD = y
INCLUDE_FRR_PBR = y
INCLUDE_FRR_VRRP = y
INCLUDE_FRR_OSPF = y
1 change: 1 addition & 0 deletions rules/frr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ FRR_SNMP_DBG = frr-snmp-dbgsym_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_$(CONFIGUR
$(eval $(call add_extra_package,$(FRR),$(FRR_SNMP_DBG)))

export FRR FRR_PYTHONTOOLS FRR_DBG FRR_SNMP FRR_SNMP_DBG
export INCLUDE_FRR_BGP INCLUDE_FRR_BFD INCLUDE_FRR_PBR INCLUDE_FRR_VRRP INCLUDE_FRR_OSPF

# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
# are archived into debug one image to facilitate debugging.
Expand Down
5 changes: 5 additions & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,11 @@ $(info "INCLUDE_PMON" : "$(INCLUDE_PMON)")
$(info "INCLUDE_DATABASE" : "$(INCLUDE_DATABASE)")
$(info "INCLUDE_SSH" : "$(INCLUDE_SSH)")
$(info "INCLUDE_SYNCD" : "$(INCLUDE_SYNCD)")
$(info "INCLUDE_FRR_BGP" : "$(INCLUDE_FRR_BGP)")
$(info "INCLUDE_FRR_BFD" : "$(INCLUDE_FRR_BFD)")
$(info "INCLUDE_FRR_PBR" : "$(INCLUDE_FRR_PBR)")
$(info "INCLUDE_FRR_VRRP" : "$(INCLUDE_FRR_VRRP)")
$(info "INCLUDE_FRR_OSPF" : "$(INCLUDE_FRR_OSPF)")
$(info "TELEMETRY_WRITABLE" : "$(TELEMETRY_WRITABLE)")
$(info "ENABLE_AUTO_TECH_SUPPORT" : "$(ENABLE_AUTO_TECH_SUPPORT)")
$(info "PDDF_SUPPORT" : "$(PDDF_SUPPORT)")
Expand Down
27 changes: 26 additions & 1 deletion src/sonic-frr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,43 @@ DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG) $(FRR_SNMP) $(FRR_SNMP_DBG)
SUFFIX = $(shell date +%Y%m%d\.%H%M%S)
STG_BRANCH = stg_temp.$(SUFFIX)

FRR_EXTRA_FLAGS = ""
ifeq ($(INCLUDE_FRR_BGP), n)
FRR_EXTRA_FLAGS += --disable-bgpd --disable-bgp-bmp
endif
ifeq ($(INCLUDE_FRR_BFD), n)
FRR_EXTRA_FLAGS += --disable-bfdd
endif
ifeq ($(INCLUDE_FRR_PBR), n)
FRR_EXTRA_FLAGS += --disable-pbrd
endif
ifeq ($(INCLUDE_FRR_VRRP), n)
FRR_EXTRA_FLAGS += --disable-vrrpd
endif
ifeq ($(INCLUDE_FRR_OSPF), n)
FRR_EXTRA_FLAGS += --disable-ospfd
FRR_EXTRA_FLAGS += --disable-ospf6d
endif

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build the package
pushd ./frr
git checkout -b $(FRR_BRANCH) origin/$(FRR_BRANCH) || git checkout $(FRR_BRANCH)
stg branch --create $(STG_BRANCH) $(FRR_TAG)
stg repair
stg import -s ../patch/series
if [[ $(INCLUDE_FRR_BGP) == n ]]; then
stg repair
stg import -s ../patch/adv1/series
fi
tools/tarsource.sh -V -e '-sonic'
DEB_CONFIGURE_EXTRA_FLAGS="$(FRR_EXTRA_FLAGS)" \
DEB_BUILD_OPTIONS=nocheck \
dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
stg undo || true
git clean -xfdf
git checkout $(FRR_BRANCH)
stg branch --delete $(STG_BRANCH)
stg branch --delete --force $(STG_BRANCH)
git rev-parse --short HEAD | xargs git checkout
git checkout master
git branch -D $(FRR_BRANCH)
Expand Down
21 changes: 21 additions & 0 deletions src/sonic-frr/patch/add-extra-configure-flags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
add extra configure flags

From: ivanekovtune-at-githedgehog <ivan@githedgehog.com>


---
debian/rules | 1 +
1 file changed, 1 insertion(+)

diff --git a/debian/rules b/debian/rules
index c8550ecb5..e0f6c1f73 100755
--- a/debian/rules
+++ b/debian/rules
@@ -65,6 +65,7 @@ override_dh_auto_configure:
--enable-vty-group=frrvty \
--enable-configfile-mask=0640 \
--enable-logfile-mask=0640 \
+ $(DEB_CONFIGURE_EXTRA_FLAGS) \
# end

override_dh_auto_install:
21 changes: 21 additions & 0 deletions src/sonic-frr/patch/adv1/add-compatibility-with-disable.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
add compatibility with disable flag

From: ivanekovtune-at-githedgehog <ivan@githedgehog.com>

remove bgpd_bmp.so from frr.install to make this file compatible with disable flag
---
debian/frr.install | 1 -
1 file changed, 1 deletion(-)

diff --git a/debian/frr.install b/debian/frr.install
index e2485fe8b..134f4f4eb 100644
--- a/debian/frr.install
+++ b/debian/frr.install
@@ -12,7 +12,6 @@ usr/lib/*/frr/modules/zebra_cumulus_mlag.so
usr/lib/*/frr/modules/dplane_fpm_nl.so
usr/lib/*/frr/modules/zebra_irdp.so
usr/lib/*/frr/modules/zebra_fpm.so
-usr/lib/*/frr/modules/bgpd_bmp.so
usr/share/doc/frr/examples
usr/share/man/
usr/share/yang/
1 change: 1 addition & 0 deletions src/sonic-frr/patch/adv1/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add-compatibility-with-disable.patch
1 change: 1 addition & 0 deletions src/sonic-frr/patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
0009-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch
0010-remove-doc-png-install.patch
0011-Ipv4-Link-local-address-for-Ipv6-linl-local-nexthop.patch
add-extra-configure-flags.patch

0 comments on commit a5edfb9

Please sign in to comment.