From 82af9ad87a9c83c88edfedf20b1abe773c4888e8 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Sun, 20 Dec 2020 15:16:58 +0100 Subject: [PATCH] Do not enable weak module support on Fedora --- dkms-no-weak-modules.conf | 1 + dkms-nvidia.spec | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 dkms-no-weak-modules.conf diff --git a/dkms-no-weak-modules.conf b/dkms-no-weak-modules.conf new file mode 100644 index 0000000..24f6f95 --- /dev/null +++ b/dkms-no-weak-modules.conf @@ -0,0 +1 @@ +NO_WEAK_MODULES="yes" diff --git a/dkms-nvidia.spec b/dkms-nvidia.spec index 77fcb67..0a29ca5 100644 --- a/dkms-nvidia.spec +++ b/dkms-nvidia.spec @@ -13,6 +13,7 @@ ExclusiveArch: x86_64 Source0: %{dkms_name}-kmod-%{version}-x86_64.tar.xz Source1: %{name}.conf +Source2: dkms-no-weak-modules.conf BuildRequires: sed @@ -35,27 +36,36 @@ sed -i -e 's/__VERSION_STRING/%{version}/g' kernel/dkms.conf %build %install -# Create empty tree +# Create empty tree: mkdir -p %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/ cp -fr kernel/* %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/ +%if 0%{?fedora} +# Do not enable weak modules support in Fedora (no kABI): +install -p -m 644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/dkms/nvidia.conf +%endif + %post dkms add -m %{dkms_name} -v %{version} -q || : -# Rebuild and make available for the currently running kernel +# Rebuild and make available for the currently running kernel: dkms build -m %{dkms_name} -v %{version} -q || : dkms install -m %{dkms_name} -v %{version} -q --force || : %preun -# Remove all versions from DKMS registry +# Remove all versions from DKMS registry: dkms remove -m %{dkms_name} -v %{version} -q --all || : %files %{_usrsrc}/%{dkms_name}-%{version} +%if 0%{?fedora} +%{_sysconfdir}/dkms/nvidia.conf +%endif %changelog * Sun Dec 20 2020 Simone Caronni - 3:460.27.04-1 - Update to 460.27.04. - Trim changelog. +- Do not enable weak module support on Fedora. * Sun Nov 29 2020 Simone Caronni - 3:455.45.01-2 - Add temporary patch for memory allocation: