From 7b2cc10558fc1f974c5c3e923754045642d580e9 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jan 2024 07:47:07 +0100 Subject: [PATCH] add nvidia libraries to ldconfig and regenerate initramfs [release 340.108-15mamba;Tue Feb 21 2023] --- nvidia_340.spec | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/nvidia_340.spec b/nvidia_340.spec index a7f0658..78b9284 100644 --- a/nvidia_340.spec +++ b/nvidia_340.spec @@ -2,7 +2,7 @@ Name: nvidia_340 Version: 340.108 Epoch: 1 -Release: 14mamba +Release: 15mamba Summary: NVIDIA proprietary accelerated drivers for the Linux Kernel Group: System/Kernel and Hardware Vendor: openmamba @@ -239,6 +239,17 @@ echo "blacklist nouveau # Install X.org configuration fragment install -D -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/20-nvidia.conf +# Add nvidia GL* libraries to ldconfig path +install -d -m0755 %{buildroot}%{_sysconfdir}/ld.so.conf.d +cat > %{buildroot}%{_sysconfdir}/ld.so.conf.d/nvidia_340.conf << __EOF +%{_libdir}/nvidia +__EOF + +install -d -m0755 %{buildroot}%{_sysconfdir}/dracut.conf.d +cat > %{buildroot}%{_sysconfdir}/dracut.conf.d/20-nvidia_340.conf << __EOF +add_drivers+=" nvidia " +__EOF + ## 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 @@ -264,22 +275,6 @@ cd current/kernel %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" -%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 remove -q -m nvidia -v 304.60 --all - dkms add -q -m %{name} -v %{version} - dkms install -q -m %{name} -v %{version} -fi -: - -%post -n xorg-drv-video-%{name} -/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} # erase dkms remove -q -m %{name} -v %{version} --all @@ -290,6 +285,20 @@ if [ $1 -eq 0 ]; then 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 remove -q -m nvidia -v 304.60 --all + dkms add -q -m %{name} -v %{version} + dkms install -q -m %{name} -v %{version} + /sbin/depmod -a -F /boot/System.map-%{kernel_ver}%{?KERNEL_TARGET} \ + %{kernel_ver}%{?KERNEL_TARGET} &>/dev/null + /usr/sbin/mkinitrd -f +fi +/sbin/ldconfig +: + %triggerpostun -n xorg-drv-video-%{name} -- xorg-drv-video-%{name} < 1:340.108-9mamba # /bin and /sbin are removed during old filesystem postun # Fixes for removal of alternatives overwriting symlinks belonging to libglvnd @@ -300,6 +309,8 @@ fi %files -n xorg-drv-video-%{name} %defattr(-,root,root) +%{_sysconfdir}/ld.so.conf.d/nvidia_340.conf +%{_sysconfdir}/dracut.conf.d/20-nvidia_340.conf #%{_sysconfdir}/profile.d/nvidia-clutter.sh %{_sysconfdir}/OpenCL/vendors/nvidia.icd %{_sysconfdir}/X11/xorg.conf.d/20-nvidia.conf @@ -338,6 +349,9 @@ fi %doc current/{NVIDIA_Changelog,README.txt} current/html %changelog +* Tue Feb 21 2023 Silvan Calarco 340.108-15mamba +- add nvidia libraries to ldconfig and regenerate initramfs + * Tue Feb 14 2023 Silvan Calarco 340.108-14mamba - fix content of /etc/X11/xorg.conf.d/20-nvidia.conf