From 43cf2813e55b5f14e1cb8bdb4ea1beed3e73479a Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jan 2024 07:47:40 +0100 Subject: [PATCH] install libnvidia-gtk3.so* to fix nvidia-settings modprobe.d/nvidia.conf: set nvidia_drm.modeset=1 dracut.conf.d/20-nvidia.conf: ensure kernel modules are added to initramfs [release 470.161.03-2mamba;Sat Mar 25 2023] --- nvidia_470.spec | 53 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/nvidia_470.spec b/nvidia_470.spec index 1061af8..8c635ad 100644 --- a/nvidia_470.spec +++ b/nvidia_470.spec @@ -3,7 +3,7 @@ Name: nvidia_470 Version: 470.161.03 Epoch: 1 -Release: 1mamba +Release: 2mamba Summary: NVIDIA proprietary accelerated drivers for the Linux Kernel Group: System/Kernel and Hardware Vendor: openmamba @@ -20,9 +20,15 @@ License: no OSI Approved BuildRequires: glibc-devel BuildRequires: libX11-devel BuildRequires: libXext-devel +BuildRequires: libat-spi2-core-devel +BuildRequires: libcairo-devel BuildRequires: libegl-wayland-devel BuildRequires: libgcc +BuildRequires: libgdk-pixbuf-devel +BuildRequires: libglib-devel BuildRequires: libglvnd-devel +BuildRequires: libgtk3-devel +BuildRequires: libpango-devel ## AUTOBUILDREQ-END ExclusiveArch: x86_64 @@ -205,6 +211,12 @@ install -D -m644 nvidia-settings.1.gz %{buildroot}%{_mandir}/man1/nvidia-setting install -D -m644 nvidia-settings.desktop %{buildroot}%{_datadir}/applications/nvidia-settings.desktop install -D -m644 nvidia-settings.png %{buildroot}%{_datadir}/pixmaps/nvidia-settings.png sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' -i %{buildroot}%{_datadir}/applications/nvidia-settings.desktop +install -D -m755 libnvidia-gtk3.so.%{version} %{buildroot}%{_libdir}/libnvidia-gtk3.so.%{version} +install -D -m 644 nvidia-settings.desktop \ + %{buildroot}%{_datadir}/applications/nvidia-settings.desktop +install -D -m 644 nvidia-settings.png \ + %{buildroot}%{_datadir}/pixmaps/nvidia-settings.png + # nvidia-bug-report install -D -m755 nvidia-bug-report.sh %{buildroot}%{_bindir}/nvidia-bug-report.sh @@ -245,11 +257,6 @@ install -D -m644 %{SOURCE2} %{buildroot}%{_datadir}/X11/xorg.conf.d/10-nvidia-dr install -Dm644 %{SOURCE1} %{buildroot}%{_sysusersdir}/nvidia.conf -install -D -m 644 nvidia-settings.desktop \ - %{buildroot}%{_datadir}/applications/nvidia-settings.desktop -install -D -m 644 nvidia-settings.png \ - %{buildroot}%{_datadir}/pixmaps/nvidia-settings.png - ## Clutter workaround (http://blog.sukimashita.com/2015/04/13/gnome-3-16-and-nvidia-binary-driver-crash-with-totem-gnome-maps-cheese-and-others/) #mkdir -p %{buildroot}%{_sysconfdir}/profile.d/ #cat > %{buildroot}%{_sysconfdir}/profile.d/nvidia-clutter.sh << _EOF @@ -260,8 +267,14 @@ install -D -m 644 nvidia-settings.png \ install -d -m0755 %{buildroot}%{_modprobedir} cat > %{buildroot}%{_modprobedir}/nvidia.conf << _EOF blacklist nouveau +options nvidia_drm modeset=1 _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 nvidia_uvm " +__EOF + # dkms install -d -m0755 %{buildroot}%{_prefix}/src/%{name}-%{version} cp -a kernel/* %{buildroot}%{_prefix}/src/%{name}-%{version}/ @@ -308,17 +321,7 @@ cd current/kernel [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %post -n xorg-drv-video-%{name} -# new install -if [ $1 -ge 1 ]; then - # clean any legacy alternatives symlink - find /lib/modules/*/kernel/drivers/video/ -name nvidia.ko -type l -exec rm -f {} \; - dkms add -q -m %{name} -v %{version} - dkms install -q -m %{name} -v %{version} -fi - /sbin/ldconfig -/sbin/depmod -a -F /boot/System.map-%{kernel_ver}%{?KERNEL_TARGET} \ - %{kernel_ver}%{?KERNEL_TARGET} &>/dev/null : %preun -n xorg-drv-video-%{name} @@ -330,6 +333,17 @@ fi : %posttrans -n xorg-drv-video-%{name} +# new install +if [ $1 -ge 1 ]; then + # clean any legacy alternatives symlink + find /lib/modules/*/kernel/drivers/video/ -name nvidia.ko -type l -exec rm -f {} \; + dkms add -q -m %{name} -v %{version} + dkms install -q -m %{name} -v %{version} +fi + +/sbin/depmod -a -F /boot/System.map-%{kernel_ver}%{?KERNEL_TARGET} \ + %{kernel_ver}%{?KERNEL_TARGET} &>/dev/null + KVER=`uname -r` INITRAMFS=/boot/initramfs-${KVER}.img [ -e ${INITRAMFS} -a %{_modprobedir}/nvidia.conf -nt ${INITRAMFS} ] || continue @@ -338,7 +352,7 @@ INITRAMFS=/boot/initramfs-${KVER}.img %files -n xorg-drv-video-%{name} %defattr(-,root,root) -#%{_sysconfdir}/profile.d/nvidia-clutter.sh +%{_sysconfdir}/dracut.conf.d/20-nvidia.conf %{_sysconfdir}/OpenCL/vendors/nvidia.icd %dir %{_prefix}/src/%{name}-%{version} %{_prefix}/src/%{name}-%{version}/* @@ -387,6 +401,11 @@ INITRAMFS=/boot/initramfs-${KVER}.img %doc current/{NVIDIA_Changelog,README.txt} current/html %changelog +* Sat Mar 25 2023 Silvan Calarco 470.161.03-2mamba +- install libnvidia-gtk3.so* to fix nvidia-settings +- modprobe.d/nvidia.conf: set nvidia_drm.modeset=1 +- dracut.conf.d/20-nvidia.conf: ensure kernel modules are added to initramfs + * Tue Mar 07 2023 Silvan Calarco 470.161.03-1mamba - update to 470.161.03