Fix conditional to only install weak-modules for RHEL

Generally speaking, weak-modules is going to be of no use to anyone,
since the stabilized kABI is a unique property that only exists
with the Red Hat Enterprise Linux distribution kernel.

To avoid issues with downstreams, flip the conditional so that it
is explicit that this is only useful for RHEL.
This commit is contained in:
Neal Gompa 2021-06-08 06:45:19 -04:00
parent 59975932b8
commit a81e15debb

View File

@ -1,15 +1,17 @@
# Fedora does not support CONFIG_MODVERSIONS. Without kabi support
# weak-modules is useless at best, and can be actively harmful.
%if 0%{?fedora}
%define with_weak_modules 0
# Since RHEL *does* support this and offers kabi support,
# turn it on there by default.
%if 0%{?rhel}
%bcond_without weak_modules
%else
%define with_weak_modules 1
%bcond_with weak_modules
%endif
Name: kmod
Version: 29
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Linux kernel module management utilities
License: GPLv2+
@ -86,7 +88,7 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d
%if %{with_weak_modules}
%if %{with weak_modules}
install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules
%endif
@ -101,7 +103,7 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules
%{_sbindir}/rmmod
%{_sbindir}/lsmod
%{_sbindir}/depmod
%if %{with_weak_modules}
%if %{with weak_modules}
%{_sbindir}/weak-modules
%endif
%{_datadir}/bash-completion/
@ -119,6 +121,9 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules
%{_libdir}/libkmod.so
%changelog
* Tue Jun 08 2021 Neal Gompa <ngompa13@gmail.com> - 29-3
- Fix conditional to only install weak-modules for RHEL
* Tue May 25 2021 Justin M. Forbes <jforbes@fedoraproject.org> - 29-2
- Rebuild for weak-modules drop in Fedora