- Why I did it To optimize Mellanox platform build - How I did it sdk debs are now downloaded as Spectrum-SDK-Drivers-SONiC-Bins release sx kernel is downloaded as zip from Spectrum-SDK-Drivers
This commit is contained in:
parent
e2e3625500
commit
ab5115846d
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -73,9 +73,6 @@
|
||||
[submodule "src/sonic-telemetry"]
|
||||
path = src/sonic-telemetry
|
||||
url = https://github.com/sonic-net/sonic-gnmi
|
||||
[submodule "Switch-SDK-drivers"]
|
||||
path = platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers
|
||||
url = https://github.com/Mellanox/Switch-SDK-drivers
|
||||
[submodule "src/sonic-ztp"]
|
||||
path = src/sonic-ztp
|
||||
url = https://github.com/sonic-net/sonic-ztp
|
||||
|
@ -5,10 +5,13 @@ MLNX_FW_BASE_PATH = $(MLNX_SDK_BASE_PATH)
|
||||
# Place an URL here to FW if you want to download FW instead
|
||||
MLNX_FW_BASE_URL =
|
||||
|
||||
ifneq ($(MLNX_FW_BASE_URL), )
|
||||
FW_FROM_URL = y
|
||||
else
|
||||
FW_FROM_URL = n
|
||||
|
||||
MLNX_FW_ASSETS_RELEASE_TAG = fw-2010.3196
|
||||
MLNX_FW_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_FW_ASSETS_RELEASE_TAG)
|
||||
|
||||
ifeq ($(MLNX_FW_BASE_URL), )
|
||||
MLNX_FW_BASE_URL = $(MLNX_FW_ASSETS_URL)
|
||||
endif
|
||||
|
||||
MLNX_SPC_FW_VERSION = 13.2010.3196
|
||||
|
@ -5,6 +5,8 @@ MAIN_TARGET = sx-kernel_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
|
||||
DERIVED_TARGETS = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
|
||||
PACKAGE_NAME = sx_kernel
|
||||
|
||||
MLNX_SX_KERNEL_GITHUB_URL_BASE = https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads
|
||||
|
||||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
# get sources
|
||||
|
||||
@ -13,9 +15,15 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz
|
||||
pushd sx_kernel-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
|
||||
else
|
||||
pushd Switch-SDK-drivers
|
||||
git reset --hard
|
||||
git clean -xfd
|
||||
rm -rf Spectrum-SDK-Drivers-$(MLNX_SDK_VERSION)
|
||||
wget -c $(MLNX_SX_KERNEL_GITHUB_URL_BASE)/$(MLNX_SDK_VERSION).zip
|
||||
unzip $(MLNX_SDK_VERSION).zip
|
||||
rm -rf $(MLNX_SDK_VERSION).zip
|
||||
|
||||
pushd Spectrum-SDK-Drivers-$(MLNX_SDK_VERSION)
|
||||
ln -s ./sx_scripts/Makefile ./Makefile
|
||||
ln -s ./sx_scripts/makefile ./makefile
|
||||
ln -s ./sx_scripts/configure ./configure
|
||||
fi
|
||||
|
||||
# build
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit a12968f165f623ff3c27d6ebaabd34cc6316497e
|
@ -1,8 +1,9 @@
|
||||
MLNX_SDK_BASE_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel/Switch-SDK-drivers/bin/
|
||||
MLNX_SDK_PKG_BASE_PATH = $(MLNX_SDK_BASE_PATH)/$(BLDENV)/$(CONFIGURED_ARCH)/
|
||||
MLNX_SDK_VERSION = 4.5.3196
|
||||
MLNX_SDK_ISSU_VERSION = 101
|
||||
|
||||
MLNX_ASSETS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins
|
||||
MLNX_SDK_ASSETS_RELEASE_TAG = sdk-$(MLNX_SDK_VERSION)-$(BLDENV)-$(CONFIGURED_ARCH)
|
||||
MLNX_SDK_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_SDK_ASSETS_RELEASE_TAG)
|
||||
MLNX_SDK_DEB_VERSION = $(subst -,.,$(subst _,.,$(MLNX_SDK_VERSION)))
|
||||
|
||||
# Place here URL where SDK sources exist
|
||||
@ -14,7 +15,7 @@ else
|
||||
SDK_FROM_SRC = n
|
||||
endif
|
||||
|
||||
export MLNX_SDK_SOURCE_BASE_URL MLNX_SDK_VERSION MLNX_SDK_ISSU_VERSION MLNX_SDK_DEB_VERSION
|
||||
export MLNX_SDK_SOURCE_BASE_URL MLNX_SDK_VERSION MLNX_SDK_ISSU_VERSION MLNX_SDK_DEB_VERSION MLNX_ASSETS_GITHUB_URL
|
||||
|
||||
MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2_MLNX) $(SX_COMPLIB) $(SX_EXAMPLES) \
|
||||
$(SX_GEN_UTILS) $(SX_SCEW) $(SXD_LIBS) $(WJH_LIBS) $(SX_ACL_HELPER)
|
||||
@ -136,21 +137,19 @@ $(SX_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel
|
||||
SX_KERNEL_DEV = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(SX_KERNEL),$(SX_KERNEL_DEV)))
|
||||
|
||||
define make_path
|
||||
$(1)_PATH = $(MLNX_SDK_PKG_BASE_PATH)
|
||||
define make_url
|
||||
$(1)_URL = $(MLNX_SDK_ASSETS_URL)/$(1)
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(foreach deb,$(MLNX_SDK_DEBS),$(call make_path,$(deb))))
|
||||
$(eval $(foreach deb,$(MLNX_SDK_RDEBS),$(call make_path,$(deb))))
|
||||
$(eval $(foreach deb,$(PYTHON_SDK_API) $(SX_KERNEL) $(SX_KERNEL_DEV),$(call make_path,$(deb))))
|
||||
$(eval $(foreach deb,$(MLNX_SDK_DEBS) $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API),$(call make_url,$(deb))))
|
||||
|
||||
SONIC_MAKE_DEBS += $(SX_KERNEL)
|
||||
|
||||
ifeq ($(SDK_FROM_SRC), y)
|
||||
SONIC_MAKE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API)
|
||||
else
|
||||
SONIC_COPY_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API)
|
||||
SONIC_ONLINE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API)
|
||||
endif
|
||||
|
||||
mlnx-sdk-packages: $(addprefix $(DEBS_PATH)/, $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) $(SX_KERNEL))
|
||||
|
Loading…
Reference in New Issue
Block a user