From cc24744829d1b6b0f4d22424714186f2d02f57bf Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Sun, 24 Oct 2010 17:20:25 +0000 Subject: [PATCH] - Improve uninstallation script rfbz#1398 - Fix selinux context on device creation rfbz#1421 --- nvidia-init | 1 + xorg-x11-drv-nvidia.spec | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/nvidia-init b/nvidia-init index 9dc12ca..9d23b15 100755 --- a/nvidia-init +++ b/nvidia-init @@ -43,6 +43,7 @@ start() { if action $"Checking for module $modname:" test -f $module;then action $"Enabling the $name driver:" $exec enable RETVAL=$? + [ -e /sbin/restorecon ] && /sbin/restorecon /dev/nvidia{ctl,0,1,2,3} else echo -en $"$modname for kernel $(uname -r) was not found." && echo_warning;echo -en '\n' echo -en $"The $name driver will not be enabled until one is found." && echo_warning;echo -en '\n' diff --git a/xorg-x11-drv-nvidia.spec b/xorg-x11-drv-nvidia.spec index e35966c..15237c6 100644 --- a/xorg-x11-drv-nvidia.spec +++ b/xorg-x11-drv-nvidia.spec @@ -9,7 +9,7 @@ Name: xorg-x11-drv-nvidia Epoch: 1 Version: 260.19.12 -Release: 2%{?dist} +Release: 3%{?dist} Summary: NVIDIA's proprietary display driver for NVIDIA graphic cards Group: User Interface/X Hardware Support @@ -250,7 +250,7 @@ if [ "$1" -eq "1" ]; then GRUBBYLASTKERNEL=`/sbin/grubby --default-kernel` /sbin/grubby --update-kernel=${GRUBBYLASTKERNEL} --args='nouveau.modeset=0 rdblacklist=nouveau' &>/dev/null fi -fi +fi || : if [ -x /usr/sbin/setsebool ] ; then SELINUXEXECSTACK=`cat /selinux/booleans/allow_execstack 2>/dev/null` if [ "${SELINUXEXECSTACK}" == "0 0" ] ; then @@ -263,9 +263,20 @@ fi ||: %preun if [ "$1" -eq "0" ]; then # Disable driver on final removal - test -f %{_sbindir}/nvidia-config-display && %{_sbindir}/nvidia-config-display disable &>/dev/null ||: - %{_initrddir}/nvidia stop &> /dev/null ||: - /sbin/chkconfig --del nvidia ||: + test -f %{_sbindir}/nvidia-config-display && %{_sbindir}/nvidia-config-display disable &>/dev/null + %{_initrddir}/nvidia stop &>/dev/null + /sbin/chkconfig --del nvidia &>/dev/null + #Clear grub option to disable nouveau for all kernels + if [ -x /sbin/grubby ] ; then + KERNELS=`ls /boot/vmlinuz-*%{?dist}.$(uname -m)` + for kernel in ${KERNELS} ; do + /sbin/grubby --update-kernel=${kernel} \ + --remove-args='nouveau.modeset=0 rdblacklist=nouveau nomodeset' &>/dev/null + done + fi + #Backup and disable previously used xorg.conf + [ -f %{_sysconfdir}/X11/xorg.conf ] && \ + mv %{_sysconfdir}/X11/xorg.conf %{_sysconfdir}/X11/xorg.conf.%{name}_uninstalled &>/dev/null fi ||: %postun libs -p /sbin/ldconfig @@ -318,8 +329,9 @@ fi ||: %changelog -* Tue Oct 19 2010 Nicolas Chauvet - 1:260.19.12-2 -- Rebuilt for repository mess +* Sun Oct 24 2010 Nicolas Chauvet - 1:260.19.12-3 +- Improve uninstallation script rfbz#1398 +- Fix selinux context on device creation rfbz#1421 * Thu Oct 14 2010 Nicolas Chauvet - 1:260.19.12-1 - Update to 260.19.12