-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sonic-net:master' into upgrade
- Loading branch information
Showing
16 changed files
with
944 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,18 +49,18 @@ go.mod: | |
|
||
$(GO_DEPS): go.mod $(PATCHES) swsscommon_wrap | ||
$(GO) mod vendor | ||
$(GO) mod download golang.org/x/[email protected] | ||
$(GO) mod download github.com/jipanyang/[email protected] | ||
cp -r $(GOPATH)/pkg/mod/golang.org/x/[email protected]/* vendor/golang.org/x/crypto/ | ||
cp -r $(GOPATH)/pkg/mod/github.com/jipanyang/[email protected]/* vendor/github.com/jipanyang/gnxi/ | ||
|
||
# Apply patch from sonic-mgmt-common, ignore glog.patch because glog version changed | ||
sed -i 's/patch -d $${DEST_DIR}\/github.com\/golang\/glog/\#patch -d $${DEST_DIR}\/github.com\/golang\/glog/g' $(MGMT_COMMON_DIR)/patches/apply.sh | ||
$(MGMT_COMMON_DIR)/patches/apply.sh vendor | ||
sed -i 's/#patch -d $${DEST_DIR}\/github.com\/golang\/glog/patch -d $${DEST_DIR}\/github.com\/golang\/glog/g' $(MGMT_COMMON_DIR)/patches/apply.sh | ||
|
||
chmod -R u+w vendor | ||
patch -d vendor -p0 < patches/gnmi_cli.all.patch | ||
patch -d vendor -p0 < patches/gnmi_set.patch | ||
patch -d vendor -p0 < patches/gnmi_get.patch | ||
patch -d vendor -p0 < patches/gnmi_path.patch | ||
patch -d vendor -p0 < patches/gnmi_xpath.patch | ||
git apply patches/0001-Updated-to-filter-and-write-to-file.patch | ||
|
||
touch $@ | ||
|
||
go-deps: $(GO_DEPS) | ||
|
@@ -69,28 +69,53 @@ go-deps-clean: | |
$(RM) -r vendor | ||
|
||
sonic-gnmi: $(GO_DEPS) | ||
# advancetls 1.0.0 release need following patch to build by go-1.19 | ||
patch -d vendor -p0 < patches/0002-Fix-advance-tls-build-with-go-119.patch | ||
# build service first which depends on advancetls | ||
ifeq ($(CROSS_BUILD_ENVIRON),y) | ||
$(GO) build -o ${GOBIN}/telemetry -mod=vendor $(BLD_FLAGS) github.com/sonic-net/sonic-gnmi/telemetry | ||
ifneq ($(ENABLE_DIALOUT_VALUE),0) | ||
$(GO) build -o ${GOBIN}/dialout_client_cli -mod=vendor $(BLD_FLAGS) github.com/sonic-net/sonic-gnmi/dialout/dialout_client_cli | ||
endif | ||
$(GO) build -o ${GOBIN}/gnmi_get -mod=vendor github.com/jipanyang/gnxi/gnmi_get | ||
$(GO) build -o ${GOBIN}/gnmi_set -mod=vendor github.com/jipanyang/gnxi/gnmi_set | ||
$(GO) build -o ${GOBIN}/gnmi_cli -mod=vendor github.com/openconfig/gnmi/cmd/gnmi_cli | ||
$(GO) build -o ${GOBIN}/gnoi_client -mod=vendor github.com/sonic-net/sonic-gnmi/gnoi_client | ||
$(GO) build -o ${GOBIN}/gnmi_dump -mod=vendor github.com/sonic-net/sonic-gnmi/gnmi_dump | ||
else | ||
$(GO) install -mod=vendor $(BLD_FLAGS) github.com/sonic-net/sonic-gnmi/telemetry | ||
ifneq ($(ENABLE_DIALOUT_VALUE),0) | ||
$(GO) install -mod=vendor $(BLD_FLAGS) github.com/sonic-net/sonic-gnmi/dialout/dialout_client_cli | ||
endif | ||
$(GO) install -mod=vendor github.com/sonic-net/sonic-gnmi/gnoi_client | ||
$(GO) install -mod=vendor github.com/sonic-net/sonic-gnmi/gnmi_dump | ||
endif | ||
|
||
# download and apply patch for gnmi client, which will break advancetls | ||
# backup crypto and gnxi | ||
mkdir backup_crypto | ||
cp -r vendor/golang.org/x/crypto/* backup_crypto/ | ||
|
||
# download and patch crypto and gnxi | ||
$(GO) mod download golang.org/x/[email protected] | ||
cp -r $(GOPATH)/pkg/mod/golang.org/x/[email protected]/* vendor/golang.org/x/crypto/ | ||
chmod -R u+w vendor | ||
patch -d vendor -p0 < patches/gnmi_cli.all.patch | ||
patch -d vendor -p0 < patches/gnmi_set.patch | ||
patch -d vendor -p0 < patches/gnmi_get.patch | ||
git apply patches/0001-Updated-to-filter-and-write-to-file.patch | ||
|
||
ifeq ($(CROSS_BUILD_ENVIRON),y) | ||
$(GO) build -o ${GOBIN}/gnmi_get -mod=vendor github.com/jipanyang/gnxi/gnmi_get | ||
$(GO) build -o ${GOBIN}/gnmi_set -mod=vendor github.com/jipanyang/gnxi/gnmi_set | ||
$(GO) build -o ${GOBIN}/gnmi_cli -mod=vendor github.com/openconfig/gnmi/cmd/gnmi_cli | ||
else | ||
$(GO) install -mod=vendor github.com/jipanyang/gnxi/gnmi_get | ||
$(GO) install -mod=vendor github.com/jipanyang/gnxi/gnmi_set | ||
$(GO) install -mod=vendor github.com/openconfig/gnmi/cmd/gnmi_cli | ||
$(GO) install -mod=vendor github.com/sonic-net/sonic-gnmi/gnoi_client | ||
$(GO) install -mod=vendor github.com/sonic-net/sonic-gnmi/gnmi_dump | ||
endif | ||
|
||
# restore old version | ||
rm -rf vendor/golang.org/x/crypto/ | ||
mv backup_crypto/ vendor/golang.org/x/crypto/ | ||
|
||
swsscommon_wrap: | ||
make -C swsscommon | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.