diff --git a/rules/config b/rules/config index 23d08fbb067e..ff3150d10600 100644 --- a/rules/config +++ b/rules/config @@ -295,3 +295,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 diff --git a/rules/frr.mk b/rules/frr.mk index 7bc5cc8024f0..a2063727c4aa 100644 --- a/rules/frr.mk +++ b/rules/frr.mk @@ -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. diff --git a/slave.mk b/slave.mk index cffa25957799..5732bbabf0a5 100644 --- a/slave.mk +++ b/slave.mk @@ -355,6 +355,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)") diff --git a/src/sonic-frr/Makefile b/src/sonic-frr/Makefile index a2e2c12885db..c39db8bcf41d 100644 --- a/src/sonic-frr/Makefile +++ b/src/sonic-frr/Makefile @@ -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 gbp dch --ignore-branch --new-version=$(FRR_VERSION)-sonic-$(FRR_SUBVERSION) --dch-opt="--force-bad-version" --commit --git-author + if [[ $(INCLUDE_FRR_BGP) == n ]]; then + stg repair + stg import -s ../patch/adv1/series + fi + 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) diff --git a/src/sonic-frr/patch/add-extra-configure-flags.patch b/src/sonic-frr/patch/add-extra-configure-flags.patch new file mode 100644 index 000000000000..ee02967711c8 --- /dev/null +++ b/src/sonic-frr/patch/add-extra-configure-flags.patch @@ -0,0 +1,21 @@ +add extra configure flags + +From: ivanekovtune-at-githedgehog + + +--- + 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: diff --git a/src/sonic-frr/patch/adv1/add-compatibility-with-disable.patch b/src/sonic-frr/patch/adv1/add-compatibility-with-disable.patch new file mode 100644 index 000000000000..a22635c12d59 --- /dev/null +++ b/src/sonic-frr/patch/adv1/add-compatibility-with-disable.patch @@ -0,0 +1,21 @@ +add compatibility with disable flag + +From: ivanekovtune-at-githedgehog + +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/ diff --git a/src/sonic-frr/patch/adv1/series b/src/sonic-frr/patch/adv1/series new file mode 100644 index 000000000000..40520af7eb06 --- /dev/null +++ b/src/sonic-frr/patch/adv1/series @@ -0,0 +1 @@ +add-compatibility-with-disable.patch diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index 5bee50310f5c..8e16dc00ef0a 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -11,3 +11,4 @@ Disable-ipv6-src-address-test-in-pceplib.patch 0010-zebra-Note-when-the-netlink-DUMP-command-is-interrup.patch 0011-bgpd-enhanced-capability-is-always-turned-on-for-int.patch 0012-Ensure-ospf_apiclient_lsa_originate-cannot-accidently-write-into-stack.patch +add-extra-configure-flags.patch