Skip to content

Commit

Permalink
[Mellanox] Enhance MFT make file to download source code from any va…
Browse files Browse the repository at this point in the history
…lid URL (#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 <[email protected]>
  • Loading branch information
keboliu authored Feb 16, 2023
1 parent e673c1d commit aee97a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion platform/mellanox/mft.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@
MFT_VERSION = 4.21.0
MFT_REVISION = 100

export MFT_VERSION MFT_REVISION
MLNX_MFT_INTERNAL_SOURCE_BASE_URL =

ifneq ($(MLNX_MFT_INTERNAL_SOURCE_BASE_URL), )
MFT_FROM_INTERNAL = y
else
MFT_FROM_INTERNAL = n
endif

export MFT_VERSION MFT_REVISION MFT_FROM_INTERNAL MLNX_MFT_INTERNAL_SOURCE_BASE_URL

MFT = mft_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED_ARCH).deb
$(MFT)_SRC_PATH = $(PLATFORM_PATH)/mft
Expand Down
8 changes: 7 additions & 1 deletion platform/mellanox/mft/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ endif
MFT_NAME = mft-$(MFT_VERSION)-$(MFT_REVISION)-$(MFT_ARCH)-deb
MFT_TGZ = $(MFT_NAME).tgz

ifeq ($(MFT_FROM_INTERNAL),y)
MFT_TGZ_URL = $(MLNX_MFT_INTERNAL_SOURCE_BASE_URL)$(MFT_TGZ)
else
MFT_TGZ_URL = http://www.mellanox.com/downloads/MFT/$(MFT_TGZ)
endif

SRC_DEB = kernel-mft-dkms_$(MFT_VERSION)-$(MFT_REVISION)_all.deb
MOD_DEB = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_$(CONFIGURED_ARCH).deb

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

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf $(MFT_NAME)
wget -O $(MFT_TGZ) http://www.mellanox.com/downloads/MFT/$(MFT_TGZ)
wget -O $(MFT_TGZ) $(MFT_TGZ_URL)
tar xzf $(MFT_TGZ)

pushd $(MFT_NAME)/SDEBS
Expand Down

0 comments on commit aee97a6

Please sign in to comment.