Skip to content

Commit

Permalink
[Mellanox]: Upgrade MFT package to 4.8.26 (sonic-net#3)
Browse files Browse the repository at this point in the history
This version is compatible with Linux kernel 4.9

Signed-off-by: marian-pritsak <marianp@mellanox.com>
  • Loading branch information
marian-pritsak authored and lguohan committed Mar 3, 2018
1 parent 194072d commit d3c4600
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions platform/mellanox/mft.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Mellanox SAI

MFT = mft-4.5.0-31.amd64.deb
MFT = mft-4.8.0-26.amd64.deb
$(MFT)_SRC_PATH = $(PLATFORM_PATH)/mft
$(MFT)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
SONIC_MAKE_DEBS += $(MFT)

KERNEL_MFT = kernel-mft-dkms_4.5.0-$(KVERSION)_all.deb
KERNEL_MFT = kernel-mft-dkms_4.8.0-$(KVERSION)_all.deb
$(eval $(call add_derived_package,$(MFT),$(KERNEL_MFT)))
16 changes: 9 additions & 7 deletions platform/mellanox/mft/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -e

MFT_NAME = mft-4.5.0-31-x86_64-deb
MFT_NAME = mft-4.8.0-26-x86_64-deb
MFT_TGZ = $(MFT_NAME).tgz
SRC_DEB = kernel-mft-dkms_4.5.0-31_all.deb
KERNELVER = 4.9.0-5-amd64
SRC_DEB = kernel-mft-dkms_4.8.0-26_all.deb

MAIN_TARGET = mft-4.5.0-31.amd64.deb
DERIVED_TARGETS = kernel-mft-dkms_4.5.0-$(KVERSION)_all.deb
MAIN_TARGET = mft-4.8.0-26.amd64.deb
DERIVED_TARGETS = kernel-mft-dkms_4.8.0-4.9.0-5-amd64_all.deb

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf $(MFT_NAME)
Expand All @@ -17,15 +19,15 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# put a lock here because dpkg does not allow installing packages in parallel
while true; do
if mkdir $(DEST)/dpkg_lock &> /dev/null; then
{ echo here && sudo dpkg -i $(SRC_DEB) && rm -d $(DEST)/dpkg_lock && break; } || { rm -d $(DEST)/dpkg_lock && exit 1 ; }
{ sudo dpkg -i $(SRC_DEB) && rm -d $(DEST)/dpkg_lock && break; } || { rm -d $(DEST)/dpkg_lock && exit 1 ; }
fi
done

tar xvf `sudo dkms mkdriverdisk kernel-mft-dkms/4.5.0 -a all -d ubuntu -k $(KVERSION) --media tar | grep "Disk image location" | cut -d':' -f2`
tar xvf `sudo dkms mkdriverdisk kernel-mft-dkms/4.8.0 -a all -d ubuntu -k $(KERNELVER) --media tar | grep "Disk image location" | cut -d':' -f2`
popd

# fix timestamp because we do not actually build tools, only kernel
touch $(MFT_NAME)/DEBS/$*
mv $(MFT_NAME)/SDEBS/ubuntu-drivers/3.16.0/$(DERIVED_TARGETS) $(MFT_NAME)/DEBS/$* $(DEST)
mv $(MFT_NAME)/SDEBS/ubuntu-drivers/4.9.0/$(DERIVED_TARGETS) $(MFT_NAME)/DEBS/$* $(DEST)

$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

0 comments on commit d3c4600

Please sign in to comment.