Accepting request 960670 from home:NMoreyChaisemartin:branches:science:HPC

- Update spec file from upstream
  - install modprobe.conf files to %_modprobedir (bsc#1196275, jsc#SLE-20639)
  - fix build support for riscv
- Added cmake-Make-modprobe.d-path-configurable.patch
  - Backport from upstream to allow modprobe files to be installed in a
    configurable directory

OBS-URL: https://build.opensuse.org/request/show/960670
OBS-URL: https://build.opensuse.org/package/show/science:HPC/rdma-core?expand=0&rev=155
This commit is contained in:
Nicolas Morey-Chaisemartin 2022-03-10 09:58:05 +00:00 committed by Git OBS Bridge
parent 2f1cefc3d8
commit b3ae92f5bf
3 changed files with 91 additions and 10 deletions

View File

@ -0,0 +1,46 @@
commit 942bb1d8657f1ed6f2c122324f2aa5e002f0cd35
Author: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
Date: Tue Mar 8 11:17:30 2022 +0100
cmake: Make modprobe.d path configurable
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
diff --git CMakeLists.txt CMakeLists.txt
index 29b177abb4d3..ac795c4b04af 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -115,6 +115,8 @@ set(IBDIAG_NODENAME_MAP_PATH "${CMAKE_INSTALL_FULL_SYSCONFDIR}/rdma/ib-node-name
set(CMAKE_INSTALL_INITDDIR "${CMAKE_INSTALL_SYSCONFDIR}/init.d"
CACHE PATH "Location for init.d files")
+set(CMAKE_INSTALL_MODPROBEDIR "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/"
+ CACHE PATH "Location for modprobe.d files")
set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system"
CACHE PATH "Location for systemd service files")
set(CMAKE_INSTALL_SYSTEMD_BINDIR "/lib/systemd"
diff --git providers/ipathverbs/CMakeLists.txt providers/ipathverbs/CMakeLists.txt
index 9031b86d0461..eaa73a8c6156 100644
--- providers/ipathverbs/CMakeLists.txt
+++ providers/ipathverbs/CMakeLists.txt
@@ -4,7 +4,7 @@ rdma_provider(ipathverbs
)
rdma_subst_install(FILES "truescale.conf.in"
- DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/"
+ DESTINATION "${CMAKE_INSTALL_MODPROBEDIR}/"
RENAME "truescale.conf")
install(FILES truescale-serdes.cmds
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}"
diff --git providers/mlx4/CMakeLists.txt providers/mlx4/CMakeLists.txt
index ad849f105231..c989c1d87ad1 100644
--- providers/mlx4/CMakeLists.txt
+++ providers/mlx4/CMakeLists.txt
@@ -13,6 +13,6 @@ publish_headers(infiniband
mlx4dv.h
)
-install(FILES "mlx4.conf" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/")
+install(FILES "mlx4.conf" DESTINATION "${CMAKE_INSTALL_MODPROBEDIR}/")
rdma_pkg_config("mlx4" "libibverbs" "${CMAKE_THREAD_LIBS_INIT}")

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Mar 10 08:24:00 UTC 2022 - Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
- Update spec file from upstream
- install modprobe.conf files to %_modprobedir (bsc#1196275, jsc#SLE-20639)
- fix build support for riscv
- Added cmake-Make-modprobe.d-path-configurable.patch
- Backport from upstream to allow modprobe files to be installed in a
configurable directory
-------------------------------------------------------------------
Fri Feb 18 07:46:41 UTC 2022 - Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>

View File

@ -25,6 +25,11 @@
%define with_pyverbs 0
%endif
%if 0%{?suse_version} < 1550 && 0%{?sle_version} <= 150300
# systemd-rpm-macros is wrong in 15.3 and below
%define _modprobedir /lib/modprobe.d
%endif
%define git_ver .0.f291942cf7c9
Name: rdma-core
Version: 38.1
@ -49,10 +54,12 @@ Group: Productivity/Networking/Other
%define mlx4_lname libmlx4-%{mlx4_so_major}
%define mlx5_lname libmlx5-%{mlx5_so_major}
%ifnarch s390 %arm
%ifnarch s390 %arm riscv64
%define dma_coherent 1
%endif
%global modprobe_d_files 50-libmlx4.conf truescale.conf %{?dma_coherent:mlx4.conf}
# Almost everything is licensed under the OFA dual GPLv2, 2 Clause BSD license
# providers/ipathverbs/ Dual licensed using a BSD license with an extra patent clause
# providers/rxe/ Incorporates code from ipathverbs and contains the patent clause
@ -71,6 +78,7 @@ Patch2: disable-rdma-interface-renaming.patch
Patch3: cxgb3-fix-declaration-of-free_context.patch
Patch4: cxgb3-fix-support-for-new-uquery-API.patch
Patch5: srp_daemon-Detect-proper-path-to-systemctl.patch
Patch6: cmake-Make-modprobe.d-path-configurable.patch
BuildRequires: binutils
BuildRequires: cmake >= 2.8.11
BuildRequires: gcc
@ -415,6 +423,7 @@ easy, object-oriented access to IB verbs.
%patch3
%patch4
%patch5
%patch6
%build
@ -439,6 +448,7 @@ easy, object-oriented access to IB verbs.
-DCMAKE_INSTALL_INCLUDEDIR:PATH=include \
-DCMAKE_INSTALL_INFODIR:PATH=%{_infodir} \
-DCMAKE_INSTALL_MANDIR:PATH=%{_mandir} \
-DCMAKE_INSTALL_MODPROBEDIR:PATH=%{_modprobedir} \
-DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \
-DCMAKE_INSTALL_SYSTEMD_SERVICEDIR:PATH=%{_unitdir} \
-DCMAKE_INSTALL_SYSTEMD_BINDIR:PATH=%{_prefix}/lib/systemd \
@ -469,24 +479,25 @@ cd ..
mkdir -p %{buildroot}/%{_sysconfdir}/rdma
%global dracutlibdir %%{_prefix}/lib/dracut/
%global sysmodprobedir %%{_sysconfdir}/modprobe.d
mkdir -p %{buildroot}%{_udevrulesdir}
mkdir -p %{buildroot}%{dracutlibdir}/modules.d/05rdma
mkdir -p %{buildroot}%{sysmodprobedir}
mkdir -p %{buildroot}%{_modprobedir}
mkdir -p %{buildroot}%{_unitdir}
# Port type setup for mlx4 dual port cards
install -D -m0644 redhat/rdma.mlx4.sys.modprobe %{buildroot}%{sysmodprobedir}/50-libmlx4.conf
install -D -m0644 redhat/rdma.mlx4.sys.modprobe %{buildroot}%{_modprobedir}/50-libmlx4.conf
install -D -m0644 redhat/rdma.mlx4.conf %{buildroot}/%{_sysconfdir}/rdma/mlx4.conf
chmod 0644 %{buildroot}%{sysmodprobedir}/50-libmlx4.conf
%if 0%{?dma_coherent}
chmod 0644 %{buildroot}%{_modprobedir}/mlx4.conf
%endif
install -D -m0755 redhat/rdma.mlx4-setup.sh %{buildroot}%{_libexecdir}/mlx4-setup.sh
# Dracut file for IB support during boot
install -D -m0644 suse/module-setup.sh %{buildroot}%{dracutlibdir}/modules.d/05rdma/module-setup.sh
%if "%{_libexecdir}" != "/usr/libexec"
sed 's-/usr/libexec-%{_libexecdir}-g' -i %{buildroot}%{sysmodprobedir}/50-libmlx4.conf
sed 's-/usr/libexec-%{_libexecdir}-g' -i %{buildroot}%{_modprobedir}/50-libmlx4.conf
sed 's-/usr/libexec-%{_libexecdir}-g' -i %{buildroot}%{dracutlibdir}/modules.d/05rdma/module-setup.sh
%endif
@ -525,11 +536,25 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh
%post -n libibmad%{mad_major} -p /sbin/ldconfig
%postun -n libibmad%{mad_major} -p /sbin/ldconfig
%pre
# Avoid restoring outdated stuff in posttrans
for _f in %{?modprobe_d_files}; do
[ ! -f "/etc/modprobe.d/${_f}.rpmsave" ] || \
mv -f "/etc/modprobe.d/${_f}.rpmsave" "/etc/modprobe.d/${_f}.rpmsave.old" || :
done
%post
# we ship udev rules, so trigger an update.
%{_bindir}/udevadm trigger --subsystem-match=infiniband --action=change || true
%{_bindir}/udevadm trigger --subsystem-match=infiniband_mad --action=change || true
%posttrans
# Migration of modprobe.conf files to _modprobedir
for _f in %{?modprobe_d_files}; do
[ ! -f "/etc/modprobe.d/${_f}.rpmsave" ] || \
mv -fv "/etc/modprobe.d/${_f}.rpmsave" "/etc/modprobe.d/${_f}" || :
done
#
# ibacm
#
@ -602,7 +627,7 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh
%dir %{_udevrulesdir}
%dir %{_sysconfdir}/udev
%dir %{_sysconfdir}/udev/rules.d
%dir %{_sysconfdir}/modprobe.d
%dir %{_modprobedir}
%doc %{_docdir}/%{name}-%{version}/README.md
%doc %{_docdir}/%{name}-%{version}/udev.md
%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
@ -612,9 +637,9 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh
%config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
%config(noreplace) %{_sysconfdir}/rdma/modules/roce.conf
%if 0%{?dma_coherent}
%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
%{_modprobedir}/mlx4.conf
%endif
%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
%{_modprobedir}/truescale.conf
%config(noreplace) %{_sysconfdir}/udev/rules.d/70-persistent-ipoib.rules
%{_unitdir}/rdma-hw.target
%{_unitdir}/rdma-load-modules@.service
@ -628,7 +653,7 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh
%{_udevrulesdir}/90-rdma-hw-modules.rules
%{_udevrulesdir}/90-rdma-ulp-modules.rules
%{_udevrulesdir}/90-rdma-umad.rules
%{sysmodprobedir}/50-libmlx4.conf
%{_modprobedir}/50-libmlx4.conf
%{_libexecdir}/mlx4-setup.sh
%{_libexecdir}/truescale-serdes.cmds
%license COPYING.*