Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nvidia] [Bookworm] Separate KERNEL_MFT into a new target #16782

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions platform/mellanox/mft.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export MFT_VERSION MFT_REVISION MFT_FROM_INTERNAL MLNX_MFT_INTERNAL_SOURCE_BASE_

MFT = mft_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED_ARCH).deb
$(MFT)_SRC_PATH = $(PLATFORM_PATH)/mft
SONIC_MAKE_DEBS += $(MFT)

$(MFT)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
MFT_OEM = mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(MFT),$(MFT_OEM)))

KERNEL_MFT = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(MFT),$(KERNEL_MFT)))
$(KERNEL_MFT)_SRC_PATH = $(PLATFORM_PATH)/mft
$(KERNEL_MFT)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)

MFT_OEM = mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(MFT),$(MFT_OEM)))
SONIC_MAKE_DEBS += $(MFT) $(KERNEL_MFT)
26 changes: 20 additions & 6 deletions platform/mellanox/mft/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,31 @@ 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
KERNEL_MFT_TARGET = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_$(CONFIGURED_ARCH).deb

MAIN_TARGET = mft_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = $(MOD_DEB) mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED_ARCH).deb

DKMS_CTRL = /var/lib/dkms/kernel-mft-dkms/
DKMS_TMP := $(shell mktemp -u -d -t dkms.XXXXXXXXXX)

MFT_TMP = /tmp/mft_build/

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
mkdir -p $(MFT_TMP)
pushd $(MFT_TMP)
wget -O $(MFT_TGZ) $(MFT_TGZ_URL)
tar xzf $(MFT_TGZ)

# fix timestamp
touch $(MFT_NAME)/DEBS/*.deb
mv $(MFT_NAME)/DEBS/*.deb $(DEST)
popd
rm -rf $(MFT_TMP)

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

$(addprefix $(DEST)/, $(KERNEL_MFT_TARGET)): $(DEST)/% :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm missing something, I think there's a chance that both this target and MAIN_TARGET could be built at the same time, in which case there would be issues here? Or would it not because MAIN_TARGET/mft is only built for Bullseye, whereas this target is built for Bookworm?

Either way, this would need to be fixed before the syncd container moves to Bookworm.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, We need MFT for bookworm & bullseye. Whereas KERNEL_MFT only for bookworm. I'd move the processing of MFT into a tmp folder, extract there and copy the files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled

rm -rf $(MFT_NAME)
wget -O $(MFT_TGZ) $(MFT_TGZ_URL)
tar xzf $(MFT_TGZ)
Expand Down Expand Up @@ -81,8 +97,6 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :

rm -rf $(DKMS_TMP)

# fix timestamp because we do not actually build tools, only kernel
touch $(MFT_NAME)/DEBS/*.deb
mv $(MFT_NAME)/DEBS/*.deb $(DEST)
mv $(MFT_NAME)/DEBS/$(KERNEL_MFT_TARGET) $(DEST)


$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
4 changes: 2 additions & 2 deletions platform/mellanox/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# TODO: update for Bookworm: mft, iproute2, sx_kernel & issu-version
include $(PLATFORM_PATH)/sdk.mk
include $(PLATFORM_PATH)/fw.mk
#include $(PLATFORM_PATH)/mft.mk
include $(PLATFORM_PATH)/mft.mk
include $(PLATFORM_PATH)/mft-fwtrace-cfg.mk
include $(PLATFORM_PATH)/mlnx-sai.mk
include $(PLATFORM_PATH)/hw-management.mk
Expand All @@ -31,7 +31,7 @@ include $(PLATFORM_PATH)/mlnx-ffb.mk
#include $(PLATFORM_PATH)/issu-version.mk
include $(PLATFORM_PATH)/mlnx-onie-fw-update.mk
include $(PLATFORM_PATH)/mlnx-ssd-fw-update.mk
#include $(PLATFORM_PATH)/iproute2.mk
include $(PLATFORM_PATH)/iproute2.mk
include $(PLATFORM_PATH)/install-pending-fw.mk
include $(PLATFORM_PATH)/integration-scripts.mk

Expand Down
2 changes: 1 addition & 1 deletion rules/docker-platform-monitor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DOCKER_PLATFORM_MONITOR_DBG = $(DOCKER_PLATFORM_MONITOR_STEM)-$(DBG_IMAGE_MARK).

$(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/$(DOCKER_PLATFORM_MONITOR_STEM)

$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(MFT)
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON)


$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY3)
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-linux-kernel
Loading