diff options
-rw-r--r-- | system/nvidia-driver/changelog.txt | 1 | ||||
-rw-r--r-- | system/nvidia-driver/nvidia-driver.SlackBuild | 156 | ||||
-rw-r--r-- | system/nvidia-driver/nvidia-driver.info | 46 | ||||
-rw-r--r-- | system/nvidia-driver/nvidia-switch | 161 |
4 files changed, 205 insertions, 159 deletions
diff --git a/system/nvidia-driver/changelog.txt b/system/nvidia-driver/changelog.txt index a467f3ee13..9bfbd1d96c 100644 --- a/system/nvidia-driver/changelog.txt +++ b/system/nvidia-driver/changelog.txt @@ -26,3 +26,4 @@ 4.5 12-MAR-2016 version update LLB, symlink fixes, drop nvidia-installer, get ready for 14.2 4.5a 26-MAR-2016 fixed broken symlinks 4.6 24-APR-2016 version update LLB, fix symlinks, added to version if multilib +4.7 31-APR-2016 version update LLB, added nvidia-installer, updated libs/symlinks diff --git a/system/nvidia-driver/nvidia-driver.SlackBuild b/system/nvidia-driver/nvidia-driver.SlackBuild index 7d858285ca..2040c422e8 100644 --- a/system/nvidia-driver/nvidia-driver.SlackBuild +++ b/system/nvidia-driver/nvidia-driver.SlackBuild @@ -26,11 +26,12 @@ # see changelog.txt PRGNAM=nvidia-driver -VERSION=${VERSION:-361.45.11} +VERSION=${VERSION:-367.44} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} CPROXY=${CPROXY:-yes} -#GLVND=${GLVND:-no} # possibly switch needed? +GLVND=${GLVND:-no} # change at your peril ;-) +# Note: libglvnd may land in X.org Mesa set -e @@ -71,6 +72,8 @@ SRCNAM=NVIDIA-Linux-$TARGET-${VERSION} rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP +rm -rf nvidia-installer-$VERSION +tar xvf $CWD/nvidia-installer-$VERSION.tar.bz2 rm -rf nvidia-settings-$VERSION tar xvf $CWD/nvidia-settings-$VERSION.tar.bz2 rm -rf nvidia-xconfig-$VERSION @@ -92,149 +95,140 @@ find -L . \ mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/{drivers,extensions} \ $PKG/etc/OpenCL/vendors/ $PKG/usr/lib$LIBDIRSUFFIX/tls \ $PKG/usr/{bin,man/man1,sbin} $PKG/usr/share/{applications,pixmaps} \ - $PKG/usr/include/GL + $PKG/usr/include/GL $PKG/etc/vulcan/ic.d/ -# Get all the libs to the right place +# Main driver install -m 755 nvidia_drv.so $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/drivers/ install -m 755 libGL.la $PKG/usr/lib$LIBDIRSUFFIX/libGL.la-nvidia -## GLVND libGL libraries for future consideration, conflict with non-GLVND versions -#install -m 755 libGL.so.1.0.0 $PKG/usr/lib$LIBDIRSUFFIX/libGL.so.1.0.0-nvidia -#install -m 755 libGLX.so.0 $PKG/usr/lib$LIBDIRSUFFIX/ -# -# non-GLVND GLX client libraries are the default -install -m 755 libGL.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ -install -m 755 libnvidia-glcore.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ -install -m 755 libnvidia-tls.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX -install -m 755 tls/libnvidia-tls.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/tls/ -# -# we'll try leaving these in to get EGL etc support that needs GLVND (see README.txt) +if [ "$GLVND" = "no" ]; then +# The non-GLVND GLX client libraries are the default + install -m 755 libGL.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +else +# GLVND libGL libraries for future consideration, conflict with non-GLVND versions + install -m 755 libGL.so.1.0.0 $PKG/usr/lib$LIBDIRSUFFIX/libGL.so.1.0.0-nvidia +fi + +# EGL requires the non-conflicting GLVND libs +install -m 755 libGLX.so.0 $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libGLX_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libOpenGL.so.0 $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libGLdispatch.so.0 $PKG/usr/lib$LIBDIRSUFFIX/ + +# we'll try leaving these in to get EGL which needs GLVND (see README.txt) install -m 755 libEGL.so.1 $PKG/usr/lib$LIBDIRSUFFIX/libEGL.so.1-nvidia +install -m 755 libEGL_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libGLESv1_CM.so.1 $PKG/usr/lib$LIBDIRSUFFIX/libGLESv1_CM.so.1-nvidia install -m 755 libGLESv2.so.2 $PKG/usr/lib$LIBDIRSUFFIX/libGLESv2.so.2-nvidia install -m 755 libGLESv1_CM_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libGLESv2_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ -install -m 755 libEGL_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ -install -m 755 libGLdispatch.so.0 $PKG/usr/lib$LIBDIRSUFFIX/ -install -m 755 libnvidia-eglcore.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ -install -m 755 libOpenGL.so.0 $PKG/usr/lib$LIBDIRSUFFIX/ -# -# Recommended GLVD bit -install -m 755 libGLX_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ -# All the rest... +# common libs +install -m 755 libOpenCL.so.1.0.0 $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libcuda.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libglx.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/extensions/libglx.so.$VERSION-nvidia -install -m 755 libOpenCL.so.1.0.0 $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvcuvid.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-cfg.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-compiler.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-eglcore.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-egl-wayland.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-encode.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-fatbinaryloader.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-fbc.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-glcore.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-glsi.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-ifr.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-ml.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-opencl.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-ptxjitcompiler.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-tls.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX +install -m 755 tls/libnvidia-tls.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/tls/ install -m 755 libvdpau_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ # For nvidia-settings GUI support install -m 755 libnvidia-gtk2.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ install -m 755 libnvidia-gtk3.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +#ICDs install -m 644 nvidia.icd $PKG/etc/OpenCL/vendors/ +install -m 644 nvidia_icd.json $PKG/etc/vulcan/ic.d/ # Add optional 32-bit support if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then mkdir -p $PKG/usr/lib/tls install -m 755 32/libGL.la $PKG/usr/lib/libGL.la-nvidia -## GLVND libGL libraries for future consideration, conflict with non-GLVND versions -#install -m 755 32/libGL.so.1.0.0 $PKG/usr/lib$LIBDIRSUFFIX/libGL.so.1.0.0-nvidia -#install -m 755 32/libGLX.so.0 $PKG/usr/lib$LIBDIRSUFFIX/ -# -# non-GLVND GLX client libraries are the default - install -m 755 32/libGL.so.$VERSION $PKG/usr/lib/ - install -m 755 32/libnvidia-glcore.so.$VERSION $PKG/usr/lib/ - install -m 755 32/libnvidia-tls.so.$VERSION $PKG/usr/lib/ - install -m 755 32/tls/libnvidia-tls.so.$VERSION $PKG/usr/lib/tls/ -# + if [ "$GLVND" = "no" ]; then +# The non-GLVND GLX client libraries are the default + install -m 755 32/libGL.so.$VERSION $PKG/usr/lib/ + else +# GLVND libGL libraries for future consideration, conflict with non-GLVND versions + install -m 755 32/libGL.so.1.0.0 $PKG/usr/lib/libGL.so.1.0.0-nvidia + fi + +# EGL requires the non-conflicting GLVND libs + install -m 755 32/libGLX_nvidia.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libOpenGL.so.0 $PKG/usr/lib/ + install -m 755 32/libGLdispatch.so.0 $PKG/usr/lib/ + install -m 755 32/libGLX.so.0 $PKG/usr/lib/ + + # we'll try leaving these in to get EGL etc support that needs GLVND (see README.txt) install -m 755 32/libEGL.so.1 $PKG/usr/lib/libEGL.so.1-nvidia + install -m 755 32/libEGL_nvidia.so.$VERSION $PKG/usr/lib/ install -m 755 32/libGLESv1_CM.so.1 $PKG/usr/lib/libGLESv1_CM.so.1-nvidia install -m 755 32/libGLESv2.so.2 $PKG/usr/lib/libGLESv2.so.2-nvidia install -m 755 32/libGLESv1_CM_nvidia.so.$VERSION $PKG/usr/lib/ install -m 755 32/libGLESv2_nvidia.so.$VERSION $PKG/usr/lib/ - install -m 755 32/libEGL_nvidia.so.$VERSION $PKG/usr/lib/ - install -m 755 32/libGLdispatch.so.0 $PKG/usr/lib/ - install -m 755 32/libnvidia-eglcore.so.$VERSION $PKG/usr/lib/ - install -m 755 32/libOpenGL.so.0 $PKG/usr/lib/ -# -# Recommended GLVD bit - install -m 755 32/libGLX_nvidia.so.$VERSION $PKG/usr/lib/ - -# And the others... +# Common libs + install -m 755 32/libOpenCL.so.1.0.0 $PKG/usr/lib/ install -m 755 32/libcuda.so.$VERSION $PKG/usr/lib/ install -m 755 32/libnvcuvid.so.$VERSION $PKG/usr/lib/ install -m 755 32/libnvidia-compiler.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-eglcore.so.$VERSION $PKG/usr/lib/ install -m 755 32/libnvidia-encode.so.$VERSION $PKG/usr/lib/ install -m 755 32/libnvidia-fatbinaryloader.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-glcore.so.$VERSION $PKG/usr/lib/ install -m 755 32/libnvidia-fbc.so.$VERSION $PKG/usr/lib/ install -m 755 32/libnvidia-glsi.so.$VERSION $PKG/usr/lib/ install -m 755 32/libnvidia-ifr.so.$VERSION $PKG/usr/lib/ install -m 755 32/libnvidia-ml.so.$VERSION $PKG/usr/lib/ install -m 755 32/libnvidia-opencl.so.$VERSION $PKG/usr/lib/ install -m 755 32/libnvidia-ptxjitcompiler.so.$VERSION $PKG/usr/lib/ - install -m 755 32/libOpenCL.so.1.0.0 $PKG/usr/lib/ install -m 755 32/libvdpau_nvidia.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-tls.so.$VERSION $PKG/usr/lib + install -m 755 32/tls/libnvidia-tls.so.$VERSION $PKG/usr/lib/tls/ fi -# symlinks +# symlinks; see also 'nvidia-switch' cd $PKG/usr/lib$LIBDIRSUFFIX - for i in libcuda libnvidia-cfg; do - ln -s $i.so.$VERSION $i.so.1 - ln -s $i.so.1 $i.so - done - ln -sf libOpenCL.so.1.0.0 libOpenCL.so.1.0 - ln -sf libOpenCL.so.1.0 libOpenCL.so.1 - ln -sf libOpenCL.so.1 libOpenCL.so - ln -sf libnvcuvid.so.$VERSION libnvcuvid.so.1 - ln -sf libnvcuvid.so.1 libnvcuvid.so + ln -sf libcuda.so.$VERSION libcuda.so ln -sf libvdpau_nvidia.so.$VERSION libvdpau_nvidia.so ln -sf libGLX_nvidia.so.$VERSION libGLX_nvidia.so.0 - ln -sf libGLX_nvidia.so.$VERSION libGLX_indirect.so.0 ln -sf libOpenGL.so.0 libOpenGL.so ln -sf libEGL_nvidia.so.$VERSION libEGL_nvidia.so.0 ln -sf libGLESv1_CM_nvidia.so.$VERSION libGLESv1_CM_nvidia.so.1 ln -sf libGLESv2_nvidia.so.$VERSION libGLESv2_nvidia.so.2 ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so - cd - - cd $PKG/usr/lib$LIBDIRSUFFIX/tls - ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so - cd - +cd - +cd $PKG/usr/lib$LIBDIRSUFFIX/tls + ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so +cd - # symlinks for optional 32-bit support if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then cd $PKG/usr/lib - ln -sf libcuda.so.$VERSION libcuda.so.1 - ln -sf libcuda.so.1 libcuda.so - ln -sf libOpenCL.so.1.0.0 libOpenCL.so.1.0 - ln -sf libOpenCL.so.1.0 libOpenCL.so.1 - ln -sf libOpenCL.so.1 libOpenCL.so - ln -sf libnvcuvid.so.$VERSION libnvcuvid.so.1 - ln -sf libnvcuvid.so.1 libnvcuvid.so + ln -sf libcuda.so.$VERSION libcuda.so ln -sf libvdpau_nvidia.so.$VERSION libvdpau_nvidia.so ln -sf libGLX_nvidia.so.$VERSION libGLX_nvidia.so.0 - ln -sf libGLX_nvidia.so.$VERSION libGLX_indirect.so.0 ln -sf libOpenGL.so.0 libOpenGL.so ln -sf libEGL_nvidia.so.$VERSION libEGL_nvidia.so.0 ln -sf libGLESv1_CM_nvidia.so.$VERSION libGLESv1_CM_nvidia.so.1 ln -sf libGLESv2_nvidia.so.$VERSION libGLESv2_nvidia.so.2 ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so - cd - - cd $PKG/usr/lib$LIBDIRSUFFIX/tls - ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so - cd - + cd - + cd $PKG/usr/lib$LIBDIRSUFFIX/tls + ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so + cd - fi # Next come the apps @@ -252,6 +246,22 @@ if [ "$ARCH" = "x86_64" -a "${CPROXY}" = "yes" ]; then install -m 644 nvidia-cuda-mps-control.1.gz $PKG/usr/man/man1/ fi +# Compiling nvidia-installer from source +# Not really needed for this SBo package...yet! +cd $TMP/nvidia-installer-$VERSION + chown -R root:root . + find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + + CFLAGS="$SLKCFLAGS" LDFLAGS="-lz" make + + install -m 755 _out/Linux_$TARGET/nvidia-installer $PKG/usr/bin/ + install -m 644 _out/Linux_$TARGET/nvidia-installer.1.gz $PKG/usr/man/man1/ +cd - + # Compiling nvidia-settings from source cd $TMP/nvidia-settings-$VERSION chown -R root:root . @@ -346,6 +356,10 @@ sed -i "s|__PIXMAP_PATH__|/usr/share/pixmaps|" \ $PKG/usr/share/applications/nvidia-settings.desktop sed -i "s|__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__|Application;Settings;|" \ $PKG/usr/share/applications/nvidia-settings.desktop +if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then + sed -i "s|__LIBGL_PATH__|/usr/lib/|" $PKG/usr/lib/libGL.la-nvidia + sed -i "s|/usr/X11R6/lib|/usr/lib/|" $PKG/usr/lib/libGL.la-nvidia +fi mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cd $TMP/$SRCNAM diff --git a/system/nvidia-driver/nvidia-driver.info b/system/nvidia-driver/nvidia-driver.info index 7950b3f974..f7c4d8bc51 100644 --- a/system/nvidia-driver/nvidia-driver.info +++ b/system/nvidia-driver/nvidia-driver.info @@ -1,26 +1,30 @@ PRGNAM="nvidia-driver" -VERSION="361.45.11" +VERSION="367.44" HOMEPAGE="http://www.nvidia.com" -DOWNLOAD="ftp://download.nvidia.com/XFree86/Linux-x86/361.45.11/NVIDIA-Linux-x86-361.45.11.run \ - ftp://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-361.45.11.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-361.45.11.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-361.45.11.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-361.45.11.tar.bz2" -MD5SUM="8d2cc688098563c36a58e2c0a914114c \ - 10f6f92a4a8a2406db7bf0f00313726b \ - 2c224952a2f493531c1fc7862bc4e5fb \ - a2dd0af40896312bf624a9912e601edf \ - 6a372c12723ad6938751058a59c1acf4" -DOWNLOAD_x86_64="ftp://download.nvidia.com/XFree86/Linux-x86_64/361.45.11/NVIDIA-Linux-x86_64-361.45.11.run \ - ftp://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-361.45.11.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-361.45.11.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-361.45.11.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-361.45.11.tar.bz2" -MD5SUM_x86_64="b0e0d7703b4fde7cc3b38bde3d015702 \ - 10f6f92a4a8a2406db7bf0f00313726b \ - 2c224952a2f493531c1fc7862bc4e5fb \ - a2dd0af40896312bf624a9912e601edf \ - 6a372c12723ad6938751058a59c1acf4" +DOWNLOAD="ftp://download.nvidia.com/XFree86/Linux-x86/367.44/NVIDIA-Linux-x86-367.44.run \ + ftp://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-367.44.tar.bz2" +MD5SUM="93ff8e1fe32939ca4fd6522b93825edc \ + f51a71ff7fcd4d5497ff0845f8cffe3a \ + d770941b0e0cd125edf2efdebbc1f1a0 \ + e30b2ff6481e188fcba57aa123c1584a \ + 2e729b8bf966d0f7239202a3f1ddf2c1 \ + aef95c4f92612770772140a11432c4d3" +DOWNLOAD_x86_64="ftp://download.nvidia.com/XFree86/Linux-x86_64/367.44/NVIDIA-Linux-x86_64-367.44.run \ + ftp://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-367.44.tar.bz2" +MD5SUM_x86_64="d34b42e64b25bf2a8d7b9a157723a3bd \ + f51a71ff7fcd4d5497ff0845f8cffe3a \ + d770941b0e0cd125edf2efdebbc1f1a0 \ + e30b2ff6481e188fcba57aa123c1584a \ + 2e729b8bf966d0f7239202a3f1ddf2c1 \ + aef95c4f92612770772140a11432c4d3" REQUIRES="nvidia-kernel" MAINTAINER="Edward W. Koenig" EMAIL="kingbeowulf@gmail.com" diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch index a657f5a52c..33d3f61d65 100644 --- a/system/nvidia-driver/nvidia-switch +++ b/system/nvidia-driver/nvidia-switch @@ -20,15 +20,14 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# nvidia-switch utility 2.5 +# nvidia-switch utility 2.6 # # A tool to install and cleanly remove the nvidia driver without stomping on the xorg files. # Note: this tool "should" allow switching on the fly, but why? Pick a driver! You will still # need to edit a bunch of other config files. -# TO-DO: needs cleanup; too brittle. - -set -e +# TO-DO: needs more cleanup; still way too brittle. +# NOTE: non-GLVND ONLY!! ROOT="${ROOT:-/}" CWD=$(pwd) @@ -39,66 +38,56 @@ LIB="${ROOT}usr/lib${LIBSUFFIX}" LIB32="${ROOT}usr/lib" XMOD="${LIB}/xorg/modules" XLIB="$XMOD/extensions" -NV_VERSION='PKGVERSION' # This will be replaced in the build script +NV_VERSION="PKGVERSION" # This will be replaced in the build script GL_VERSION="1.2.0" NV_CONF="/usr/share/X11/xorg.conf.d/10-nvidia.conf" save_GL(){ cd $2 if [ "$1" = "nvidia" ]; then - if [ -e libGL.so.$GL_VERSION ]; then - mv libGL.so.$GL_VERSION libGL.so.$GL_VERSION-xorg - mv libGL.la libGL.la-xorg - fi + mv libGL.so.$GL_VERSION libGL.so.$GL_VERSION-xorg + mv libGL.la libGL.la-xorg mv libGL.la-nvidia libGL.la ln -sf libGL.so.$NV_VERSION libGL.so.1 ln -sf libGL.so.$NV_VERSION libGL.so - if [ -e libEGL.so.1.0.0 ]; then - mv libEGL.so.1.0.0 libEGL.so.1.0.0-xorg - fi - mv libEGL.so.1-nvidia libEGL.so.$NV_VERSION - ln -sf libEGL.so.$NV_VERSION libEGL.so.1 - ln -sf libEGL.so.1 libEGL.so - if [ -e libGLESv1_CM.so.1.1.0 ]; then - mv libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1.1.0-xorg - fi - mv libGLESv1_CM.so.1-nvidia libGLESv1_CM.so.$NV_VERSION - ln -sf libGLESv1_CM.so.$NV_VERSION libGLESv1_CM.so.1 - ln -sf libGLESv1_CM.so.1 libGLESv1_CM.so - if [ -e libGLESv2.so.2.0.0 ]; then - mv libGLESv2.so.2.0.0 libGLESv2.so.2.0.0-xorg - fi - mv libGLESv2.so.2-nvidia libGLESv2.so.$NV_VERSION - ln -sf libGLESv2.so.$NV_VERSION libGLESv2.so.2 - ln -sf libGLESv2.so.2 libGLESv2.so + + mv libEGL.so.1.0.0 libEGL.so.1.0.0-xorg + mv libEGL.so.1-nvidia libEGL.so.1.0.0 + ln -sf libEGL.so.1.0.0 libEGL.so.1 + ln -sf libEGL.so.1.0.0 libEGL.so + + mv libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1.1.0-xorg + mv libGLESv1_CM.so.1-nvidia libGLESv1_CM.so.1.1.0 + ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so + ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1 + + mv libGLESv2.so.2.0.0 libGLESv2.so.2.0.0-xorg + mv libGLESv2.so.2-nvidia libGLESv2.so.2.0.0 + ln -sf libGLESv2.so.2.0.0 libGLESv2.so.2 + ln -sf libGLESv2.so.2.0.0 libGLESv2.so fi if [ "$1" = "xorg" ]; then mv libGL.la libGL.la-nvidia - if [ -e libGL.so.$GL_VERSION-xorg ]; then - mv libGL.so.$GL_VERSION-xorg libGL.so.$GL_VERSION - ln -sf libGL.so.$GL_VERSION libGL.so.1 - ln -sf libGL.so.$GL_VERSION libGL.so - mv libGL.la-xorg libGL.la - fi - mv libEGL.so.$NV_VERSION libEGL.so.1-nvidia - if [ -e libEGL.so.1.0.0-xorg ]; then - mv libEGL.so.1.0.0-xorg libEGL.so.1.0.0 - ln -sf libEGL.so.1.0.0 libEGL.so.1 - ln -sf libEGL.so.1.0.0 libEGL.so - fi - mv libGLESv2.so.$NV_VERSION libGLESv2.so.2-nvidia - if [ -e libGLESv2.so.2.0.0-xorg ]; then - mv libGLESv2.so.2.0.0-xorg libGLESv2.so.2.0.0 - ln -sf libGLESv2.so.2.0.0 libGLESv2.so.2 - ln -sf libGLESv2.so.2.0.0 libGLESv2.so - fi - mv libGLESv1_CM.so.$NV_VERSION libGLESv1_CM.so.1-nvidia - if [ -e libGLESv1_CM.so.1.1.0-xorg ]; then - mv libGLESv1_CM.so.1.1.0-xorg libGLESv1_CM.so.1.1.0 - ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1 - ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so - fi + mv libGL.la-xorg libGL.la + mv libGL.so.$GL_VERSION-xorg libGL.so.$GL_VERSION + ln -sf libGL.so.$GL_VERSION libGL.so.1 + ln -sf libGL.so.$GL_VERSION libGL.so + + mv libEGL.so.1.0.0 libEGL.so.1-nvidia + mv libEGL.so.1.0.0-xorg libEGL.so.1.0.0 + ln -sf libEGL.so.1.0.0 libEGL.so.1 + ln -sf libEGL.so.1.0.0 libEGL.so + + mv libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1-nvidia + mv libGLESv1_CM.so.1.1.0-xorg libGLESv1_CM.so.1.1.0 + ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1 + ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so + + mv libGLESv2.so.2.0.0 libGLESv2.so.2-nvidia + mv libGLESv2.so.2.0.0-xorg libGLESv2.so.2.0.0 + ln -sf libGLESv2.so.2.0.0 libGLESv2.so.2 + ln -sf libGLESv2.so.2.0.0 libGLESv2.so fi cd "$CWD" } @@ -106,17 +95,14 @@ save_GL(){ save_glx(){ cd "$XLIB" if [ "$1" = "nvidia" ]; then - if [ ! -e libglx.so-xorg ]; then - mv libglx.la libglx.la-xorg - mv libglx.so libglx.so-xorg - fi - ln -sf libglx.so.$NV_VERSION-nvidia libglx.so.$NV_VERSION + mv libglx.so libglx.so-xorg + mv libglx.so.$NV_VERSION-nvidia libglx.so.$NV_VERSION ln -sf libglx.so.$NV_VERSION libglx.so - elif [ "$1" = "xorg" ]; then - rm -f libglx.so.$NV_VERSION + fi + if [ "$1" = "xorg" ]; then + mv libglx.so.$NV_VERSION libglx.so.$NV_VERSION-nvidia rm -f libglx.so mv libglx.so-xorg libglx.so - mv libglx.la-xorg libglx.la fi cd "$CWD" } @@ -133,8 +119,8 @@ nvidia_install(){ echo "and in /etc/X11/xorg.conf.d." echo "Otherwise, this may lead to improperly working drivers." - save_GL "nvidia" $LIB save_glx "nvidia" + save_GL "nvidia" $LIB # Check for multilib configuration if [ "$COMPAT32" = "yes" ]; then save_GL "nvidia" $LIB32 @@ -143,18 +129,18 @@ nvidia_install(){ nvidia_remove(){ echo $'Returning to stock xorg files!\n' - echo "Make sure the nvidia driver is DISABLED in /etc/X11/xorg.conf" - echo "and in /etc/X11/xorg.conf.d." + echo "Make sure the nvidia driver is DISABLED in /usr/share/X11/xorg.conf.d" + echo "/etc/X11/xorg.conf and in /etc/X11/xorg.conf.d." echo "Otherwise, this may lead to improperly working drivers." - save_GL "xorg" $LIB save_glx "xorg" - - # Kill dangling symlinks; check next mesa version for libGLES presence. + save_GL "xorg" $LIB + + # Kill dangling symlinks; rm -f $LIB/libnvidia*.so.1 rm -f $LIB/libvdpau_nvidia.so.1 rm -f $LIB/libcuda.so.1 - + # Check for multilib configuration if [ "$COMPAT32" = "yes" ]; then save_GL "xorg" $LIB32 @@ -165,14 +151,53 @@ nvidia_remove(){ fi if [ -e $NV_CONF ]; then - rm -f $NV_CONF + echo "removing $NV_CONF: you will need to provide your own" + echo "or reinstall nvidia-driver." + rm -f $NV_CONF fi } +restore(){ +# Attempts to reinstall damaged stock packages if something went wrong. +# Obviously, you will need to run this after '--remove' and before +# 'removepkg nvidia-driver'. +# User must: +# 1. remove any dangling symlinks and *-xorg, *-nvidia files in /usr/lib?/, +# and any other housekeeping tasks. +# 2. copy stock Slackware packages to /root/Slackware +# 3. be running STOCK Slackware-14.2 +# 4. realize that COMPAT32 is not supported ;-) + +if [ "$LIBSUFFIX" = "64" ]; then + ARCH="x86_64" +else + ARCH="x86" +fi + +PKGPATH="/root/Slackware" +MESA="mesa-11.2.2-$ARCH-1.txz" +MESA32="mesa-compat32-11.2.2-$ARCH-1compat32.txz" +XORG="xorg-1.18.3-$ARCH-2.txz" + +if [ -d $PKGPATH ]; then + if [ `find $PKGPATH -prune -empty -type d` ]; then + echo "Your $PKGPATH is empty!" + else + upgradepkg --reinstall $MESA $XORG + if [ "COMPAT32" = "yes" ]; then + upgradepkg --reinstall $MESA32 + fi + fi +else + echo "Please create $PKGPATH containing the appropriate packages" +fi +} + usage(){ echo "Usage:" echo " --install Set up nvidia driver files (only during pkg install)" echo " --remove Return to stock xorg files and remove all symlinks" + echo " --restore Reinstall stock Mesa and xorg-server [EXPERIMENTAL]" echo " --help Show this help message" } @@ -180,6 +205,8 @@ if [ "$1" = '--install' ]; then nvidia_install elif [ "$1" = '--remove' ]; then nvidia_remove +elif [ "$1" = '--restore' ]; then + restore elif [ "$1" = '--help' ]; then usage else |