fix nvidia-settings by installing libnvidia-gtk3.so.*

modprobe.d/nvidia.conf: set nvidia_drm.modeset=1
dracut.conf.d/20-nvidia.conf: ensure kernel modules are added to initramfs [release 530.41.03-2mamba;Sat Mar 25 2023]
This commit is contained in:
Silvan Calarco 2024-01-06 07:45:40 +01:00
parent 21b939d8d4
commit 24387c35b8

View File

@ -3,7 +3,7 @@
Name: nvidia
Version: 530.41.03
Epoch: 1
Release: 1mamba
Release: 2mamba
Summary: NVIDIA proprietary accelerated drivers for the Linux Kernel
Group: System/Kernel and Hardware
Vendor: openmamba
@ -216,6 +216,11 @@ 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
@ -256,11 +261,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
@ -271,8 +271,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 "
__EOF
# dkms
install -d -m0755 %{buildroot}%{_prefix}/src/%{name}-%{version}
cp -a kernel/* %{buildroot}%{_prefix}/src/%{name}-%{version}/
@ -296,7 +302,6 @@ BUILT_MODULE_NAME[3]=nvidia-uvm
BUILT_MODULE_LOCATION[3]=./
DEST_MODULE_LOCATION[3]=/kernel/drivers/video
%endif
REMAKE_INITRD=no
AUTOINSTALL=yes
_EOF
@ -323,17 +328,7 @@ nvidia-uvm \
[ "%{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}
@ -345,6 +340,16 @@ fi
:
%posttrans -n xorg-drv-video-%{name}
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
@ -353,7 +358,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}/*
@ -403,6 +408,11 @@ INITRAMFS=/boot/initramfs-${KVER}.img
%doc current/{NVIDIA_Changelog,README.txt} current/html
%changelog
* Sat Mar 25 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 530.41.03-2mamba
- fix nvidia-settings by installing libnvidia-gtk3.so.*
- modprobe.d/nvidia.conf: set nvidia_drm.modeset=1
- dracut.conf.d/20-nvidia.conf: ensure kernel modules are added to initramfs
* Fri Mar 24 2023 Automatic Build System <autodist@mambasoft.it> 530.41.03-1mamba
- automatic version update by autodist