Files
kernel/kernel-modules/mlnx-ofa_kernel/debian/deb_patches/0002-mlnx-ofa_kernel-Add-dev-package.patch
Jiping Ma bd9c042318 mlnx-ofa_kernel:Upgrade OFED driver version to 24.10
This upgrades the OFED driver package to the mlnx-ofa_kernel-24.10.tgz
located in https://linux.mellanox.com/public/repo/mlnx_ofed/
24.10-1.1.4.0/SRPMS/. As part of the plan to upgrade to the 6.12
kernel, we also want to update the Nvidia/Mellanox driver to the
latest supported version.

The new versions are:
    mlnx-ofa_kernel-24.10.tgz
    dma-core-2410mlnx54.tar.gz
    mlnx-tools-24.10.tar.gz

Verification:
- Build module success for kernel-std/kernel-rt.
- Build package success for rdma-core, mstflint and mlnx-tools.
- Install onto a StarlingX system with All-in-One lab with network
  adapters Mellanox's OFED. The network adapters of controllers
  are Mellanox Technologies MT27800 Family [ConnectX-5].
- Install onto a StarlingX system in labs with network
  adapters Mellanox's OFED. The network adapters of controllers
  are [ConnectX-6 DX],[ConnectX-6 LX].
- The physical function interfaces are up and pass packets for rt
  and std.
- create vfs, ensure that the interface can come up and pass packets.
- RDMA/Infiniband over Ethernet functionalities of the Mellanox adapters
  were successfully tested using the Linux RDMA community's perftest
  package.

Story: 2011384
Task: 51890

Depends-On: https://review.opendev.org/c/starlingx/kernel/+/945449
Change-Id: I1a9f7881e3ba6805354f684b2001bc931350f348
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
2025-04-09 08:12:32 +00:00

249 lines
7.7 KiB
Diff

From 27c4b861cef239a3939e9b159d88294b0d6bfe78 Mon Sep 17 00:00:00 2001
From: Jiping Ma <jiping.ma2@windriver.com>
Date: Sun, 22 May 2022 21:02:25 -0700
Subject: [PATCH 2/2] mlnx-ofa_kernel: Add dev package.
This commit moves source code files "/usr/src/ofa_kernel/x86_64/" from
modules package to dev package, only leaving all ko in modules package.
Also adds postinst, prerm files for dev package and modify postinst,
prerm files for modules package because source files are moved to
the dev package.
It will generate mlnx-ofed-kernel-dev and mlnx-ofed-kernel-dev-rt with
adding @KERNEL_TYPE@ suffix, which are used to build other modules that
based on ofed for std and rt building.
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
[jm: Adapted the patch for context change]
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
[jm: Adapted the patch for context change with the 24.10 version.]
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
---
debian/control | 6 ++++++
debian/mlnx-ofed-kernel-dev-rt.postinst | 17 +++++++++++++++++
debian/mlnx-ofed-kernel-dev-rt.prerm | 10 ++++++++++
debian/mlnx-ofed-kernel-dev.postinst | 17 +++++++++++++++++
debian/mlnx-ofed-kernel-dev.prerm | 10 ++++++++++
debian/mlnx-ofed-kernel-modules-rt.postinst | 12 ------------
debian/mlnx-ofed-kernel-modules-rt.prerm | 7 -------
debian/mlnx-ofed-kernel-modules.postinst | 12 ------------
debian/mlnx-ofed-kernel-modules.prerm | 7 -------
debian/rules | 17 +++++++++--------
10 files changed, 69 insertions(+), 46 deletions(-)
create mode 100755 debian/mlnx-ofed-kernel-dev-rt.postinst
create mode 100755 debian/mlnx-ofed-kernel-dev-rt.prerm
create mode 100755 debian/mlnx-ofed-kernel-dev.postinst
create mode 100755 debian/mlnx-ofed-kernel-dev.prerm
diff --git a/debian/control b/debian/control
index 701a9c5..6df229d 100644
--- a/debian/control
+++ b/debian/control
@@ -18,3 +18,9 @@ Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, mlnx-ofed-kernel-utils
Description: ofed kernel modules
This package provides the mlnx-ofed out of tree kernel modules.
+
+Package: mlnx-ofed-kernel-dev@KERNEL_TYPE@
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: ofed kernel modules
+ This package provides the source code for the mlnx-ofed kernel modules.
diff --git a/debian/mlnx-ofed-kernel-dev-rt.postinst b/debian/mlnx-ofed-kernel-dev-rt.postinst
new file mode 100755
index 0000000..a67c0c4
--- /dev/null
+++ b/debian/mlnx-ofed-kernel-dev-rt.postinst
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+symlink="/usr/src/ofa_kernel/default"
+if [ "$1" = "configure" ]; then
+ if [ -L "$symlink" ] && \
+ ! update-alternatives --list ofa_kernel_headers >/dev/null 2>&1;
+ then
+ rm -f "$symlink"
+ fi
+ mkdir -p /usr/src/ofa_kernel
+ update-alternatives --install "$symlink" ofa_kernel_headers \
+ /usr/src/ofa_kernel/@ARCH@/@KVER@ 30
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/mlnx-ofed-kernel-dev-rt.prerm b/debian/mlnx-ofed-kernel-dev-rt.prerm
new file mode 100755
index 0000000..6f1b1df
--- /dev/null
+++ b/debian/mlnx-ofed-kernel-dev-rt.prerm
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = remove ]; then
+ update-alternatives --remove ofa_kernel_headers \
+ /usr/src/ofa_kernel/@ARCH@/@KVER@
+fi
+
+#DEBHELPER#
diff --git a/debian/mlnx-ofed-kernel-dev.postinst b/debian/mlnx-ofed-kernel-dev.postinst
new file mode 100755
index 0000000..a67c0c4
--- /dev/null
+++ b/debian/mlnx-ofed-kernel-dev.postinst
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+symlink="/usr/src/ofa_kernel/default"
+if [ "$1" = "configure" ]; then
+ if [ -L "$symlink" ] && \
+ ! update-alternatives --list ofa_kernel_headers >/dev/null 2>&1;
+ then
+ rm -f "$symlink"
+ fi
+ mkdir -p /usr/src/ofa_kernel
+ update-alternatives --install "$symlink" ofa_kernel_headers \
+ /usr/src/ofa_kernel/@ARCH@/@KVER@ 30
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/mlnx-ofed-kernel-dev.prerm b/debian/mlnx-ofed-kernel-dev.prerm
new file mode 100755
index 0000000..6f1b1df
--- /dev/null
+++ b/debian/mlnx-ofed-kernel-dev.prerm
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = remove ]; then
+ update-alternatives --remove ofa_kernel_headers \
+ /usr/src/ofa_kernel/@ARCH@/@KVER@
+fi
+
+#DEBHELPER#
diff --git a/debian/mlnx-ofed-kernel-modules-rt.postinst b/debian/mlnx-ofed-kernel-modules-rt.postinst
index a67c0c4..3456fe9 100755
--- a/debian/mlnx-ofed-kernel-modules-rt.postinst
+++ b/debian/mlnx-ofed-kernel-modules-rt.postinst
@@ -1,17 +1,5 @@
#!/bin/bash
-symlink="/usr/src/ofa_kernel/default"
-if [ "$1" = "configure" ]; then
- if [ -L "$symlink" ] && \
- ! update-alternatives --list ofa_kernel_headers >/dev/null 2>&1;
- then
- rm -f "$symlink"
- fi
- mkdir -p /usr/src/ofa_kernel
- update-alternatives --install "$symlink" ofa_kernel_headers \
- /usr/src/ofa_kernel/@ARCH@/@KVER@ 30
-fi
-
#DEBHELPER#
exit 0
diff --git a/debian/mlnx-ofed-kernel-modules-rt.prerm b/debian/mlnx-ofed-kernel-modules-rt.prerm
index 6f1b1df..a2c66fa 100755
--- a/debian/mlnx-ofed-kernel-modules-rt.prerm
+++ b/debian/mlnx-ofed-kernel-modules-rt.prerm
@@ -1,10 +1,3 @@
#!/bin/sh
-set -e
-
-if [ "$1" = remove ]; then
- update-alternatives --remove ofa_kernel_headers \
- /usr/src/ofa_kernel/@ARCH@/@KVER@
-fi
-
#DEBHELPER#
diff --git a/debian/mlnx-ofed-kernel-modules.postinst b/debian/mlnx-ofed-kernel-modules.postinst
index a67c0c4..3456fe9 100755
--- a/debian/mlnx-ofed-kernel-modules.postinst
+++ b/debian/mlnx-ofed-kernel-modules.postinst
@@ -1,17 +1,5 @@
#!/bin/bash
-symlink="/usr/src/ofa_kernel/default"
-if [ "$1" = "configure" ]; then
- if [ -L "$symlink" ] && \
- ! update-alternatives --list ofa_kernel_headers >/dev/null 2>&1;
- then
- rm -f "$symlink"
- fi
- mkdir -p /usr/src/ofa_kernel
- update-alternatives --install "$symlink" ofa_kernel_headers \
- /usr/src/ofa_kernel/@ARCH@/@KVER@ 30
-fi
-
#DEBHELPER#
exit 0
diff --git a/debian/mlnx-ofed-kernel-modules.prerm b/debian/mlnx-ofed-kernel-modules.prerm
index 6f1b1df..a2c66fa 100755
--- a/debian/mlnx-ofed-kernel-modules.prerm
+++ b/debian/mlnx-ofed-kernel-modules.prerm
@@ -1,10 +1,3 @@
#!/bin/sh
-set -e
-
-if [ "$1" = remove ]; then
- update-alternatives --remove ofa_kernel_headers \
- /usr/src/ofa_kernel/@ARCH@/@KVER@
-fi
-
#DEBHELPER#
diff --git a/debian/rules b/debian/rules
index 94d1616..d19f467 100755
--- a/debian/rules
+++ b/debian/rules
@@ -49,6 +49,7 @@ else
pdkms:=$(pname)-modules@KERNEL_TYPE@
endif
putils:=$(pname)-utils
+pdev:=$(pname)-dev@KERNEL_TYPE@
pversion := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)-.\+/\1/p')
prel := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)-\(.\+\)/\2/p')
@@ -134,12 +135,12 @@ ifeq ($(WITH_DKMS),1)
dh_installdirs -p$(pdkms) usr/src/ofa_kernel/
# copy the ofa-kernel build headers using ofed_scripts/pre_build.sh in the DKMS MAKE step (called from ofed_scripts/pre_build.sh).
else
- dh_installdirs -p$(pdkms) $(mod_dev_dir)
- cp -a include/ debian/$(pdkms)$(mod_dev_dir)
- cp -a config* debian/$(pdkms)$(mod_dev_dir)
- cp -a compat* debian/$(pdkms)$(mod_dev_dir)
- cp -a ofed_scripts debian/$(pdkms)$(mod_dev_dir)
- cp -a Module*.symvers debian/$(pdkms)$(mod_dev_dir)
+ dh_installdirs -p$(pdev) $(mod_dev_dir)
+ cp -a include/ debian/$(pdev)$(mod_dev_dir)
+ cp -a config* debian/$(pdev)$(mod_dev_dir)
+ cp -a compat* debian/$(pdev)$(mod_dev_dir)
+ cp -a ofed_scripts debian/$(pdev)$(mod_dev_dir)
+ cp -a Module*.symvers debian/$(pdev)$(mod_dev_dir)
endif
# Force DKMS to install our modules.
@@ -230,8 +231,8 @@ else
sed -i \
-e 's/@KVER@/$(kernelver)/' \
-e 's/@ARCH@/$(deb_arch)/' \
- debian/$(pdkms)/DEBIAN/postinst \
- debian/$(pdkms)/DEBIAN/prerm
+ debian/$(pdev)/DEBIAN/postinst \
+ debian/$(pdev)/DEBIAN/prerm
endif
ifneq ($(MLNX_KO_NO_STRIP),1)
--
2.47.1