Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sonic frr makefile to handle multiple builds #3483

Closed
wants to merge 8 commits into from
26 changes: 17 additions & 9 deletions src/sonic-frr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@ SHELL = /bin/bash

MAIN_TARGET = $(FRR)
DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG) $(FRR_SNMP) $(FRR_SNMP_DBG)
BRANCH = $(shell date +%Y%m%d\.%H%M%S)

patch1 = 0001-Add-support-of-bgp-tcp-DSCP-value.patch
patch2 = 0002-Reduce-severity-of-Vty-connected-from-message.patch
patch3 = 0003-ignore-nexthop-attribute-when-NLRI-is-present.patch
patch4 = 0004-Allow-BGP-attr-NEXT_HOP-to-be-0.0.0.0-due-to-allevia.patch
patch5 = 0005-Support-VRF.patch

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build the package
pushd ./frr
git checkout -b $(BRANCH) origin/frr/7.0
stg init
stg import -s ../patch/series
pushd ./frr
for frr_patch in $(patch1) $(patch2) $(patch3) $(patch4) $(patch5); do
if patch -sfp1 --dry-run < ../patch/$$frr_patch; then
patch -sfp1 < ../patch/$$frr_patch
else
if ! patch -Rsfp1 --dry-run < ../patch/$$frr_patch; then
echo "Patch $$frr_patch failure"
exit 1
fi
fi
done
tools/tarsource.sh -V -e '-sonic'
dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS)
stg undo
git clean -xfdf
git checkout frr/7.0
git branch -D $(BRANCH)
popd
mv $(DERIVED_TARGET) $* $(DEST)/

Expand Down