Skip to content

Commit d736b06

Browse files
keboliumssonicbld
authored andcommitted
[Mellanox] Enhance MFT make file to download source code from any valid URL (sonic-net#13801)
- Why I did it Currently, when building MFT, it can only download the source code from the official download site: http://www.mellanox.com/downloads/MFT/, it's not possible to integrate an internal version that has not been officially released yet. The intention of this PR is to make it possible to download the source code from any valid link. - How I did it Add a new parameter "MLNX_MFT_INTERNAL_SOURCE_BASE_URL", if an URL is given, it will download the source code from the given URL, otherwise, it downloads from the default official site. - How to verify it Specify a valid URL in the make file, the MFT debs should be built successfully. Signed-off-by: Kebo Liu <kebol@nvidia.com>
1 parent 1d155b8 commit d736b06

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

platform/mellanox/mft.mk

+9-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@
1919
MFT_VERSION = 4.21.0
2020
MFT_REVISION = 100
2121

22-
export MFT_VERSION MFT_REVISION
22+
MLNX_MFT_INTERNAL_SOURCE_BASE_URL =
23+
24+
ifneq ($(MLNX_MFT_INTERNAL_SOURCE_BASE_URL), )
25+
MFT_FROM_INTERNAL = y
26+
else
27+
MFT_FROM_INTERNAL = n
28+
endif
29+
30+
export MFT_VERSION MFT_REVISION MFT_FROM_INTERNAL MLNX_MFT_INTERNAL_SOURCE_BASE_URL
2331

2432
MFT = mft_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED_ARCH).deb
2533
$(MFT)_SRC_PATH = $(PLATFORM_PATH)/mft

platform/mellanox/mft/Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ endif
2727
MFT_NAME = mft-$(MFT_VERSION)-$(MFT_REVISION)-$(MFT_ARCH)-deb
2828
MFT_TGZ = $(MFT_NAME).tgz
2929

30+
ifeq ($(MFT_FROM_INTERNAL),y)
31+
MFT_TGZ_URL = $(MLNX_MFT_INTERNAL_SOURCE_BASE_URL)$(MFT_TGZ)
32+
else
33+
MFT_TGZ_URL = http://www.mellanox.com/downloads/MFT/$(MFT_TGZ)
34+
endif
35+
3036
SRC_DEB = kernel-mft-dkms_$(MFT_VERSION)-$(MFT_REVISION)_all.deb
3137
MOD_DEB = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_$(CONFIGURED_ARCH).deb
3238

@@ -38,7 +44,7 @@ DKMS_TMP := $(shell mktemp -u -d -t dkms.XXXXXXXXXX)
3844

3945
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
4046
rm -rf $(MFT_NAME)
41-
wget -O $(MFT_TGZ) http://www.mellanox.com/downloads/MFT/$(MFT_TGZ)
47+
wget -O $(MFT_TGZ) $(MFT_TGZ_URL)
4248
tar xzf $(MFT_TGZ)
4349

4450
pushd $(MFT_NAME)/SDEBS

0 commit comments

Comments
 (0)