From c9e1873409e725b7a74ab958da63dd933873e2af Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Sun, 29 Aug 2021 04:34:48 +0000 Subject: [PATCH 1/2] oMake neccesary changed to mellanox platform code to build on Debian 11 --- platform/mellanox/mft.mk | 2 +- platform/mellanox/mft/Makefile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index 6e9ff7a33fe..3ac25a550e9 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -26,7 +26,7 @@ $(MFT)_SRC_PATH = $(PLATFORM_PATH)/mft SONIC_MAKE_DEBS += $(MFT) ifeq ($(DISTRO), bullseye) -$(MFT)_DEPENDS = $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(MFT)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) endif KERNEL_MFT = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_amd64.deb diff --git a/platform/mellanox/mft/Makefile b/platform/mellanox/mft/Makefile index efa791dba1d..fe9f9a1d515 100644 --- a/platform/mellanox/mft/Makefile +++ b/platform/mellanox/mft/Makefile @@ -35,6 +35,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : wget -O $(MFT_TGZ) http://www.mellanox.com/downloads/MFT/$(MFT_TGZ) tar xzf $(MFT_TGZ) +ifeq ($(DISTRO), bullseye) pushd $(MFT_NAME)/SDEBS # put a lock here because dpkg does not allow installing packages in parallel @@ -62,6 +63,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : popd rm -rf $(DKMS_TMP) +endif # fix timestamp because we do not actually build tools, only kernel touch $(MFT_NAME)/DEBS/*.deb From bf596592814a8c2df6dc6df4b599e43ef162aa06 Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Fri, 29 Oct 2021 22:42:57 +0000 Subject: [PATCH 2/2] Revert use of backported kernel to build mft and elect to only build kernel module under bullseye --- platform/mellanox/mft.mk | 2 +- platform/mellanox/mft/Makefile | 2 +- platform/mellanox/rules.mk | 6 ------ sonic-slave-buster/Dockerfile.j2 | 4 ---- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index 3ac25a550e9..f7b45bf29ef 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -27,10 +27,10 @@ SONIC_MAKE_DEBS += $(MFT) ifeq ($(DISTRO), bullseye) $(MFT)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) -endif KERNEL_MFT = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_amd64.deb $(eval $(call add_derived_package,$(MFT),$(KERNEL_MFT))) +endif MFT_OEM = mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_amd64.deb $(eval $(call add_derived_package,$(MFT),$(MFT_OEM))) diff --git a/platform/mellanox/mft/Makefile b/platform/mellanox/mft/Makefile index fe9f9a1d515..c1798dcc768 100644 --- a/platform/mellanox/mft/Makefile +++ b/platform/mellanox/mft/Makefile @@ -47,7 +47,7 @@ ifeq ($(DISTRO), bullseye) popd - sudo dkms build kernel-mft-dkms/$(MFT_VERSION) -k $(KVERSION) -a amd64 --kernelsourcedir /usr/src/linux-headers-$(KVERSION) + sudo dkms build kernel-mft-dkms/$(MFT_VERSION) -k $(KVERSION) -a amd64 sudo dkms mkbmdeb kernel-mft-dkms/$(MFT_VERSION) -k $(KVERSION) -a amd64 # w/a: remove dependencies diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index 54daddd0d1a..be046bed91e 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -14,12 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -# Set KVERSION correctly depending on build environment -ifeq ($(BLDENV), buster) -KVERSION = 5.10.0-0.bpo.8-amd64 -endif - include $(PLATFORM_PATH)/sdk.mk include $(PLATFORM_PATH)/fw.mk include $(PLATFORM_PATH)/mft.mk diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 9d2e831b0ea..3ac1709d20d 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -153,10 +153,6 @@ RUN apt-get update && apt-get install -y \ # For mellanox sai build libtool-bin \ libxml2-dev \ -# For mellanox MFT build - linux-image-5.10.0-0.bpo.8-amd64 \ - linux-headers-5.10.0-0.bpo.8-amd64 \ - linux-headers-5.10.0-0.bpo.8-common \ # For BFN sdk build libusb-1.0-0-dev \ libcurl3-nss-dev \