[Mellanox] update sdk/fw build procedure (#14025) (#14059)

This commit is contained in:
mssonicbld 2023-03-03 02:43:19 +08:00 committed by GitHub
parent 72f9f51287
commit 1757f53290
No account linked to committer's email address
5 changed files with 25 additions and 19 deletions

3
.gitmodules vendored
View File

@ -78,9 +78,6 @@
[submodule "src/sonic-mgmt-framework"] [submodule "src/sonic-mgmt-framework"]
path = src/sonic-mgmt-framework path = src/sonic-mgmt-framework
url = https://github.com/sonic-net/sonic-mgmt-framework url = https://github.com/sonic-net/sonic-mgmt-framework
[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"] [submodule "src/sonic-ztp"]
path = src/sonic-ztp path = src/sonic-ztp
url = https://github.com/sonic-net/sonic-ztp url = https://github.com/sonic-net/sonic-ztp

View File

@ -23,10 +23,13 @@ MLNX_FW_BASE_URL =
SIMX_VERSION = 5.1-1065 SIMX_VERSION = 5.1-1065
ifneq ($(MLNX_FW_BASE_URL), )
FW_FROM_URL = y FW_FROM_URL = y
else
FW_FROM_URL = n MLNX_FW_ASSETS_RELEASE_TAG = fw-2010.4150
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 endif
MLNX_SPC_FW_VERSION = 13.2010.4150 MLNX_SPC_FW_VERSION = 13.2010.4150

View File

@ -5,6 +5,8 @@ MAIN_TARGET = sx-kernel_1.mlnx.$(MLNX_SDK_DEB_VERSION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_$(CONFIGURED_ARCH).deb DERIVED_TARGETS = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_$(CONFIGURED_ARCH).deb
PACKAGE_NAME = sx_kernel 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)/% : $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources # 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 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) pushd sx_kernel-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
else else
pushd Switch-SDK-drivers rm -rf Spectrum-SDK-Drivers-$(MLNX_SDK_VERSION)
git reset --hard wget -c $(MLNX_SX_KERNEL_GITHUB_URL_BASE)/$(MLNX_SDK_VERSION).zip
git clean -xfd 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 fi
# build # build

@ -1 +0,0 @@
Subproject commit c66b48a7aa609b4e4a927c5f3fa9039d1a9bde28

View File

@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
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.4150 MLNX_SDK_VERSION = 4.5.4150
MLNX_SDK_ISSU_VERSION = 101 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))) MLNX_SDK_DEB_VERSION = $(subst -,.,$(subst _,.,$(MLNX_SDK_VERSION)))
# Place here URL where SDK sources exist # Place here URL where SDK sources exist
@ -30,7 +31,7 @@ else
SDK_FROM_SRC = n SDK_FROM_SRC = n
endif 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) \ MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2_MLNX) $(SX_COMPLIB) $(SX_EXAMPLES) \
$(SX_GEN_UTILS) $(SX_SCEW) $(SXD_LIBS) $(WJH_LIBS) $(SX_ACL_HELPER) \ $(SX_GEN_UTILS) $(SX_SCEW) $(SXD_LIBS) $(WJH_LIBS) $(SX_ACL_HELPER) \
@ -163,21 +164,19 @@ $(SX_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel
SX_KERNEL_DEV = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_$(CONFIGURED_ARCH).deb SX_KERNEL_DEV = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(SX_KERNEL),$(SX_KERNEL_DEV))) $(eval $(call add_derived_package,$(SX_KERNEL),$(SX_KERNEL_DEV)))
define make_path define make_url
$(1)_PATH = $(MLNX_SDK_PKG_BASE_PATH) $(1)_URL = $(MLNX_SDK_ASSETS_URL)/$(1)
endef endef
$(eval $(foreach deb,$(MLNX_SDK_DEBS),$(call make_path,$(deb)))) $(eval $(foreach deb,$(MLNX_SDK_DEBS) $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API),$(call make_url,$(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))))
SONIC_MAKE_DEBS += $(SX_KERNEL) SONIC_MAKE_DEBS += $(SX_KERNEL)
ifeq ($(SDK_FROM_SRC), y) ifeq ($(SDK_FROM_SRC), y)
SONIC_MAKE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) SONIC_MAKE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API)
else else
SONIC_COPY_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) SONIC_ONLINE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API)
endif endif
mlnx-sdk-packages: $(addprefix $(DEBS_PATH)/, $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) $(SX_KERNEL)) mlnx-sdk-packages: $(addprefix $(DEBS_PATH)/, $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) $(SX_KERNEL))