From 8429ffcc6959b89abcfefee763df3eefb853fcb8 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 25 Aug 2024 21:20:27 +0200 Subject: [PATCH] added nvidia-fallback service which loads nouveau as fallback if nvidia driver is not loaded before display-manager remove simplefb causing plymouth to block at boot if nvidia driver is not loaded [release 560.35.03-2mamba;Sun Aug 25 2024] --- nvidia-fallback.service | 17 ++++++++++++++++ nvidia.spec | 43 +++++++++++++++++++++++++++++------------ 2 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 nvidia-fallback.service diff --git a/nvidia-fallback.service b/nvidia-fallback.service new file mode 100644 index 0000000..38a598c --- /dev/null +++ b/nvidia-fallback.service @@ -0,0 +1,17 @@ +[Unit] +Description=Fallback to nouveau as nvidia did not load +After=akmods.service +Before=display-manager.service +ConditionKernelCommandLine=rd.driver.blacklist=nouveau +ConditionPathExists=!/sys/module/nvidia + + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=-/sbin/modprobe nouveau +ExecStartPost=-/bin/plymouth message --text="NVIDIA kernel module missing. Falling back to nouveau" + + +[Install] +WantedBy=graphical.target diff --git a/nvidia.spec b/nvidia.spec index bcf83e2..2413d69 100644 --- a/nvidia.spec +++ b/nvidia.spec @@ -1,9 +1,9 @@ %define nvidia_current_ver %version %define nvidia_current_libver %version Name: nvidia -Version: 555.58.02 +Version: 560.35.03 Epoch: 1 -Release: 1mamba +Release: 2mamba Summary: NVIDIA proprietary accelerated drivers for the Linux Kernel Group: System/Kernel and Hardware Vendor: openmamba @@ -13,6 +13,7 @@ URL: https://www.nvidia.com/en-us/drivers/unix/ Source0: http://us.download.nvidia.com/XFree86/Linux-x86_64/%{nvidia_current_ver}/NVIDIA-Linux-x86_64-%{nvidia_current_ver}.run Source1: nvidia.sysusers Source2: nvidia-drm-outputclass.conf +Source3: nvidia-fallback.service Patch0: nvidia-331.20-x86-conftest.patch Patch1: nvidia-367.35-kernel-4.6.patch License: no OSI Approved @@ -273,16 +274,19 @@ blacklist nouveau options nvidia_drm modeset=1 _EOF -install -d -m0755 %{buildroot}%{_modulesloaddir} -cat > %{buildroot}%{_modulesloaddir}/nvidia.conf << _EOF -simplefb -_EOF +#install -d -m0755 %{buildroot}%{_modulesloaddir} +#cat > %{buildroot}%{_modulesloaddir}/nvidia.conf << _EOF +#simplefb +#_EOF install -d -m0755 %{buildroot}%{_sysconfdir}/dracut.conf.d cat > %{buildroot}%{_sysconfdir}/dracut.conf.d/20-nvidia.conf << __EOF add_drivers+=" nvidia nvidia_drm nvidia_modeset " __EOF +# fallback service which loads nouveau driver if nvidia was not loaded +install %{SOURCE3} %{buildroot}%{_unitdir}/nvidia-fallback.service + # dkms install -d -m0755 %{buildroot}%{_prefix}/src/%{name}-%{version} cp -a kernel/* %{buildroot}%{_prefix}/src/%{name}-%{version}/ @@ -332,15 +336,16 @@ nvidia-uvm \ [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %post -n xorg-drv-video-%{name} -/sbin/ldconfig +%systemd_post nvidia-fallback : %preun -n xorg-drv-video-%{name} -# erase +%systemd_preun nvidia-fallback dkms remove -q -m nvidia -v %{version} --all -if [ $1 -eq 0 ]; then - /sbin/ldconfig -fi +: + +%postun -n xorg-drv-video-%{name} +%systemd_postun nvidia-fallback : %posttrans -n xorg-drv-video-%{name} @@ -369,13 +374,14 @@ INITRAMFS=/boot/initramfs-${KVER}.img %{_prefix}/lib/firmware/nvidia/%{version}/*.bin %{_bindir}/nvidia-* %{_modprobedir}/nvidia.conf -%{_modulesloaddir}/nvidia.conf +#%{_modulesloaddir}/nvidia.conf %{_systemd_util_dir}/system-sleep/nvidia %{_unitdir}/nvidia-hibernate.service %{_unitdir}/nvidia-persistenced.service %{_unitdir}/nvidia-powerd.service %{_unitdir}/nvidia-suspend.service %{_unitdir}/nvidia-resume.service +%{_unitdir}/nvidia-fallback.service %{_sysusersdir}/nvidia.conf %{_datadir}/dbus-1/system.d/nvidia-dbus.conf %{_libdir}/libEGL_nvidia.so.* @@ -413,6 +419,19 @@ INITRAMFS=/boot/initramfs-${KVER}.img %doc current/{NVIDIA_Changelog,README.txt} current/html %changelog +* Sun Aug 25 2024 Silvan Calarco 560.35.03-2mamba +- added nvidia-fallback service which loads nouveau as fallback if nvidia driver is not loaded before display-manager +- remove simplefb causing plymouth to block at boot if nvidia driver is not loaded + +* Thu Aug 22 2024 Automatic Build System 560.35.03-1mamba +- automatic version update by autodist + +* Wed Aug 07 2024 Automatic Build System 560.31.02-1mamba +- automatic version update by autodist + +* Tue Jul 23 2024 Automatic Build System 560.28.03-1mamba +- automatic version update by autodist + * Tue Jul 02 2024 Automatic Build System 555.58.02-1mamba - automatic version update by autodist