From 4eb6f1908f48721e207c5b3f9b73fdcfac337a92 Mon Sep 17 00:00:00 2001 From: Jianping Liu Date: Tue, 27 Aug 2024 19:01:43 +0800 Subject: [PATCH] dist: not integrate mlnx commercial drivers in oc9 Some oc9 partners have nic driver, and the driver support RDMA and the driver only compatble with kernel native infiniband. If integrate mlnx driver, oc9 partners RDMA nic driver cloud not run. Signed-off-by: Jianping Liu Reviewed-by: Yongliang Gao --- dist/Makefile | 2 ++ dist/templates/kernel.template.spec | 27 +++++++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/dist/Makefile b/dist/Makefile index ebc9029cb27e..cc0c914bd779 100644 --- a/dist/Makefile +++ b/dist/Makefile @@ -159,7 +159,9 @@ dist-tarball: dist-drivers: @echo "Preparing thirdparty drivers." +ifneq ($(KDIST),oc9) @cd $(TOPDIR)/dist/sources/ ; ./download-and-copy-drivers.sh ; cd $(TOPDIR) +endif $(CONFIGFILE): $(DISTFILES) @echo "Generating kernel config style '$(CONFIG)'" diff --git a/dist/templates/kernel.template.spec b/dist/templates/kernel.template.spec index 52ccbd8e9fc8..8cd4141ab933 100644 --- a/dist/templates/kernel.template.spec +++ b/dist/templates/kernel.template.spec @@ -472,7 +472,12 @@ This package provides debug information for the bpftool package. # To avoid compile error, do not integrate mlnx commercial quality drivers if not tencentos release. # Users could compile and install MLNX_OFED_LINUX-* manually. -%if "%{?dist}" != ".tl4" && "%{?dist}" != ".oc9" && "%{?dist}" != ".tl3" +# +# Some oc9 partners have nic driver, and the driver support RDMA and only compatble with kernel native infiniband. +# If integrate mlnx driver, oc9 partners RDMA nic driver cloud not run. +# +# %if "%{?dist}" != ".tl4" && "%{?dist}" != ".oc9" && "%{?dist}" != ".tl3" +%if "%{?dist}" != ".tl4" && "%{?dist}" != ".tl3" %define with_ofed 0 %endif @@ -628,15 +633,17 @@ case $KernUnameR in # Prepare Kernel config BuildConfig() { - # Prepare git sub-module, copy thirdparty drivers to override kernel native drivers - pushd ${_KernSrc}/drivers/thirdparty - rm -f download-and-copy-drivers.sh; cp -a %{SOURCE3000} ./ - if [ -e ../../dist/sources ]; then - ./copy-drivers.sh - else - cp -a %{SOURCE3001} release-drivers/mlnx/ - fi - popd + # Copy mlnx drivers to drivers/thirdparty/release-drivers/mlnx/ dir + %if %{with_ofed} + pushd ${_KernSrc}/drivers/thirdparty + rm -f download-and-copy-drivers.sh; cp -a %{SOURCE3000} ./ + if [ -e ../../dist/sources ]; then + ./copy-drivers.sh + else + cp -a %{SOURCE3001} release-drivers/mlnx/ + fi + popd + %endif mkdir -p $_KernBuild pushd $_KernBuild