202 lines
7.0 KiB
Diff
202 lines
7.0 KiB
Diff
From ddb4a37a859259d13945fc18b59045cffb51f93c Mon Sep 17 00:00:00 2001
|
|
Message-Id: <ddb4a37a859259d13945fc18b59045cffb51f93c.1586811171.git.Jim.Somerville@windriver.com>
|
|
From: Jim Somerville <Jim.Somerville@windriver.com>
|
|
Date: Mon, 20 Jan 2020 11:40:06 -0500
|
|
Subject: [PATCH 1/1] Support TiS system
|
|
|
|
This patch added the following to support TiS system:
|
|
- Support package versioning for TiS format
|
|
- Add rt support
|
|
- Compile fix in dcbnl.h
|
|
- Fix compile for some ks stuff
|
|
- Fix compile to neuter some stats output
|
|
- Disable use of kernel page pool functionality
|
|
- Load all kernel modules
|
|
- Sign kernel module
|
|
|
|
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
|
|
Signed-off-by: Kam Nasim <kam.nasim@windriver.com>
|
|
Signed-off-by: eric zhang <eric.zhang@windriver.com>
|
|
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
|
---
|
|
SPECS/mlnx-ofa_kernel.spec | 51 +++++++++++++++++++++++++++++++---------------
|
|
1 file changed, 35 insertions(+), 16 deletions(-)
|
|
|
|
diff --git a/SPECS/mlnx-ofa_kernel.spec b/SPECS/mlnx-ofa_kernel.spec
|
|
index efe2abc..619e470 100644
|
|
--- a/SPECS/mlnx-ofa_kernel.spec
|
|
+++ b/SPECS/mlnx-ofa_kernel.spec
|
|
@@ -27,8 +27,14 @@
|
|
#
|
|
|
|
# KMP is disabled by default
|
|
-%{!?KMP: %global KMP 0}
|
|
+%if "%{_tis_build_type}" == "rt"
|
|
+%define bt_ext -rt
|
|
+%else
|
|
+%undefine bt_ext
|
|
+%endif
|
|
|
|
+%{!?KMP: %global KMP 0}
|
|
+BuildRequires: kernel%{?bt_ext}-devel, openssl
|
|
%global WITH_SYSTEMD %(if ( test -d "%{_unitdir}" > /dev/null); then echo -n '1'; else echo -n '0'; fi)
|
|
|
|
%{!?configure_options: %global configure_options --with-core-mod --with-user_mad-mod --with-user_access-mod --with-addr_trans-mod --with-mlx4-mod --with-mlx4_en-mod --with-mlx5-mod --with-mlxfw-mod --with-ipoib-mod}
|
|
@@ -55,12 +61,11 @@
|
|
|
|
%global IS_RHEL_VENDOR "%{_vendor}" == "redhat" || ("%{_vendor}" == "bclinux")
|
|
|
|
-%{!?KVERSION: %global KVERSION %(uname -r)}
|
|
+%{!?KVERSION: %global KVERSION %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')}
|
|
%global kernel_version %{KVERSION}
|
|
%global krelver %(echo -n %{KVERSION} | sed -e 's/-/_/g')
|
|
# take path to kernel sources if provided, otherwise look in default location (for non KMP rpms).
|
|
-%{!?K_SRC: %global K_SRC /lib/modules/%{KVERSION}/build}
|
|
-
|
|
+%{!?K_SRC: %global K_SRC /usr/src/kernels/%{KVERSION}}
|
|
# Select packages to build
|
|
|
|
# Kernel module packages to be included into kernel-ib
|
|
@@ -76,7 +81,9 @@
|
|
|
|
%{!?KERNEL_SOURCES: %global KERNEL_SOURCES /lib/modules/%{KVERSION}/source}
|
|
|
|
-%{!?_name: %global _name mlnx-ofa_kernel}
|
|
+
|
|
+%define _basename mlnx-ofa_kernel
|
|
+%define _name %{_basename}%{?bt_ext}
|
|
%{!?_version: %global _version 5.0}
|
|
%{!?_release: %global _release OFED.5.0.2.1.8.1.g5f67178}
|
|
%global _kmp_rel %{_release}%{?_kmp_build_num}%{?_dist}
|
|
@@ -94,11 +101,17 @@
|
|
Summary: Infiniband HCA Driver
|
|
Name: %{_name}
|
|
Version: %{_version}
|
|
-Release: %{_release}%{?_dist}
|
|
+Release: %{_release}%{?_tis_dist}.%{tis_patch_ver}
|
|
License: GPLv2
|
|
Url: http://www.mellanox.com/
|
|
Group: System Environment/Base
|
|
-Source: %{_name}-%{_version}.tgz
|
|
+Source: %{_basename}-%{_version}.tgz
|
|
+Source100: modules-load.conf
|
|
+Patch01: 0001-neuter-HAVE_IEEE_GETQCN.patch
|
|
+Patch02: 0001-neuter-a-bunch-of-ks-stuff.patch
|
|
+Patch03: 0001-neuter-some-stats-output.patch
|
|
+Patch04: Disable-use-of-page-pool.patch
|
|
+
|
|
BuildRoot: %{?build_root:%{build_root}}%{!?build_root:/var/tmp/OFED}
|
|
Vendor: Mellanox Technologies
|
|
Obsoletes: kernel-ib
|
|
@@ -154,7 +167,6 @@ EOF)
|
|
%global kernel_release() %{KVERSION}
|
|
%global flavors_to_build default
|
|
%package -n %{non_kmp_pname}
|
|
-Requires: %{utils_pname}
|
|
Requires: coreutils
|
|
Requires: pciutils
|
|
Requires: grep
|
|
@@ -181,7 +193,7 @@ Obsoletes: mlnx-en-doc
|
|
Obsoletes: mlnx-en-debuginfo
|
|
Obsoletes: mlnx-en-sources
|
|
Version: %{_version}
|
|
-Release: %{_release}.kver.%{krelver}
|
|
+Release: %{_release}%{?_tis_dist}.%{tis_patch_ver}
|
|
Summary: Infiniband Driver and ULPs kernel modules
|
|
Group: System Environment/Libraries
|
|
%description -n %{non_kmp_pname}
|
|
@@ -193,7 +205,7 @@ The driver sources are located at: http://www.mellanox.com/downloads/ofed/mlnx-o
|
|
%package -n %{devel_pname}
|
|
Version: %{_version}
|
|
# build KMP rpms?
|
|
-Release: %{_release}%{?_dist}
|
|
+Release: %{_release}%{?_dist}%{?_tis_dist}.%{tis_patch_ver}
|
|
Obsoletes: kernel-ib-devel
|
|
Obsoletes: compat-rdma-devel
|
|
Obsoletes: kernel-ib
|
|
@@ -231,13 +243,12 @@ The driver sources are located at: http://www.mellanox.com/downloads/ofed/mlnx-o
|
|
else \
|
|
echo -n '0'; fi)
|
|
|
|
-%if "%{WITH_MOD_SIGN}" == "1"
|
|
# call module sign script
|
|
%global __modsign_install_post \
|
|
%{_builddir}/$NAME-$VERSION/source/ofed_scripts/tools/sign-modules %{buildroot}/lib/modules/ %{kernel_source default} || exit 1 \
|
|
%{nil}
|
|
|
|
-%global __debug_package 1
|
|
+%define debug_package %{nil}
|
|
%global buildsubdir %{_name}-%{version}
|
|
# Disgusting hack alert! We need to ensure we sign modules *after* all
|
|
# invocations of strip occur, which is in __debug_install_post if
|
|
@@ -250,7 +261,6 @@ The driver sources are located at: http://www.mellanox.com/downloads/ofed/mlnx-o
|
|
%{__modsign_install_post} \
|
|
%{nil}
|
|
|
|
-%endif # end of setup module sign scripts
|
|
#
|
|
%if "%{_vendor}" == "suse"
|
|
%debug_package
|
|
@@ -281,7 +291,7 @@ The driver sources are located at: http://www.mellanox.com/downloads/ofed/mlnx-o
|
|
%{!?install_mod_dir: %global install_mod_dir updates}
|
|
|
|
%prep
|
|
-%setup -n %{_name}-%{_version}
|
|
+%setup -n %{_basename}-%{_version}
|
|
set -- *
|
|
mkdir source
|
|
mv "$@" source/
|
|
@@ -290,6 +300,11 @@ sed -s -i -e '1s|python\>|python3|' `grep -rl '^#!.*python' source/ofed_scripts`
|
|
%endif
|
|
mkdir obj
|
|
|
|
+%patch01 -p1
|
|
+%patch02 -p1
|
|
+%patch03 -p1
|
|
+%patch04 -p1
|
|
+
|
|
%build
|
|
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
|
|
export INSTALL_MOD_DIR=%{install_mod_dir}
|
|
@@ -305,7 +320,6 @@ for flavor in %flavors_to_build; do
|
|
find compat -type f -exec touch -t 200012201010 '{}' \; || true
|
|
./configure --build-dummy-mods --prefix=%{_prefix} --kernel-version $KVERSION --kernel-sources $KSRC --modules-dir $LIB_MOD_DIR $CONF_OPTIONS %{?_smp_mflags}
|
|
make %{?_smp_mflags} kernel
|
|
- make build_py_scripts
|
|
cd -
|
|
done
|
|
|
|
@@ -314,9 +328,11 @@ touch ofed-files
|
|
export RECORD_PY_FILES=1
|
|
export INSTALL_MOD_PATH=%{buildroot}
|
|
export INSTALL_MOD_DIR=%{install_mod_dir}
|
|
-export NAME=%{name}
|
|
+export NAME=%{_basename}
|
|
export VERSION=%{version}
|
|
export PREFIX=%{_prefix}
|
|
+export MODULE_SIGN_PRIV_KEY=/usr/src/kernels/%{KVERSION}/signing_key.priv
|
|
+export MODULE_SIGN_PUB_KEY=/usr/src/kernels/%{KVERSION}/signing_key.x509
|
|
%{mlnx_python_env}
|
|
for flavor in %flavors_to_build; do
|
|
export KSRC=%{kernel_source $flavor}
|
|
@@ -367,6 +383,8 @@ echo "override ${mod_name} * weak-updates/%{_name}${mod_path}" >> %{buildroot}%{
|
|
echo "override ${mod_name} * extra/%{_name}${mod_path}" >> %{buildroot}%{_sysconfdir}/depmod.d/zz01-%{_name}-${mod_name}.conf
|
|
done
|
|
%endif
|
|
+%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
|
|
+%{__install} -m 644 %{SOURCE100} %{buildroot}%{_sysconfdir}/modules-load.d/mlnx.conf
|
|
%endif
|
|
|
|
# copy sources
|
|
@@ -712,6 +730,7 @@ fi
|
|
%config(noreplace) %{_sysconfdir}/depmod.d/zz01-%{_name}-*.conf
|
|
%endif
|
|
%endif
|
|
+%{_sysconfdir}/modules-load.d/mlnx.conf
|
|
%endif
|
|
|
|
%files -n %{devel_pname}
|
|
--
|
|
1.8.3.1
|
|
|