commit 2d1ee4ce6b6e2fa1b19bdac7a6781fcc9c01377d
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Tue May 30 18:01:38 2017 +0200
Add dracut.conf.d/99-nvidia.conf file
Add dracut.conf.d/99-nvidia.conf file enforcing that the nvidia modules never
get added to the initramfs.
This is necessary because the userspace bits and the kernel modules must
be 100% in sync, otherwise things might break. Normally we build the initrd
before building the dkms / akmod so this issue will only happen if the initrd
somehow gets re-generated afterwards, still this is something which we should
avoid.
Patch from Hans de Goede
99-nvidia-dracut.conf | 3 +++
xorg-x11-drv-nvidia.spec | 14 ++++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/99-nvidia-dracut.conf b/99-nvidia-dracut.conf
new file mode 100644
index 0000000..68b6e93
--- /dev/null
+++ b/99-nvidia-dracut.conf
@@ -0,0 +1,3 @@
+# omit the nvidia driver from the ramdisk, to avoid needing to regenerate
+# the ramdisk on nvidia driver updates
+omit_drivers+=" nvidia-drm "
diff --git a/xorg-x11-drv-nvidia.spec b/xorg-x11-drv-nvidia.spec
index a1d67dd..782ccff 100644
--- a/xorg-x11-drv-nvidia.spec
+++ b/xorg-x11-drv-nvidia.spec
@@ -13,8 +13,10 @@
%global _udevrulesdir %{_prefix}/lib/udev/rules.d/
%global _modprobe_d %{_sysconfdir}/modprobe.d/
%global _dracutopts nouveau.modeset=0 rdblacklist=nouveau
+%global _dracut_conf_d %{_sysconfdir}/dracut.conf.d
%global _grubby /sbin/grubby --grub --update-kernel=ALL
%else #rhel > 6 or fedora
+%global _dracut_conf_d %{_prefix}/lib/dracut.conf.d
%global _modprobe_d %{_prefix}/lib/modprobe.d/
%global _grubby %{_sbindir}/grubby --update-kernel=ALL
%if 0%{?rhel} == 7
@@ -31,7 +33,7 @@
Name: xorg-x11-drv-nvidia
Epoch: 2
Version: 375.66
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: NVIDIA's proprietary display driver for NVIDIA graphic cards
License: Redistributable, no modification permitted
@@ -51,6 +53,7 @@ Source12: xorg-x11-drv-nvidia.metainfo.xml
Source13: parse-readme.py
Source14: 60-nvidia-uvm.rules
Source15: nvidia-uvm.conf
+Source16: 99-nvidia-dracut.conf
ExclusiveArch: i686 x86_64 armv7hl
@@ -293,6 +296,10 @@ install -p -m 0644 %{SOURCE6} %{buildroot}%{_modprobe_d}
install -m 0755 -d %{buildroot}%{_udevrulesdir}
install -p -m 0644 %{SOURCE14} %{buildroot}%{_udevrulesdir}
+# dracut.conf.d file, nvidia modules must never be in the initrd
+install -p -m 0755 -d %{buildroot}%{_dracut_conf_d}/
+install -p -m 0644 %{SOURCE16} %{buildroot}%{_dracut_conf_d}/
+
# Install binaries
install -m 0755 -d %{buildroot}%{_bindir}
install -p -m 0755
nvidia-{bug-report.sh,debugdump,smi,cuda-mps-control,cuda-mps-server,xconfig,settings,persistenced}
\
@@ -476,8 +483,10 @@ fi ||:
# RHEL6 uses /etc
%if 0%{?rhel} == 6
%config(noreplace) %{_modprobe_d}/blacklist-nouveau.conf
+%config(noreplace) %{_dracut_conf_d}/99-nvidia-dracut.conf
%else
%{_modprobe_d}/blacklist-nouveau.conf
+%{_dracut_conf_d}/99-nvidia-dracut.conf
%endif
%endif
%config %{_sysconfdir}/xdg/autostart/nvidia-settings.desktop
@@ -584,8 +593,9 @@ fi ||:
%{_libdir}/libnvidia-encode.so
%changelog
-* Tue May 30 2017 Nicolas Chauvet <kwizart(a)gmail.com> - 2:375.66-4
+* Tue May 30 2017 Nicolas Chauvet <kwizart(a)gmail.com> - 2:375.66-5
- Update the triggerin to insert the new cmdline
+- Avoid the nvidia modules to get added to the initramfs - patch by hansg
* Tue May 30 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 2:375.66-3
- Revert 10_nvidia.json rename