diff options
author | Lenard Spencer <lenardrspencer@gmail.com> | 2020-04-10 00:28:23 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-04-10 00:28:23 +0700 |
commit | d10cd53348e12573a0df7f6957fab09e9f320784 (patch) | |
tree | bced3a21759a58c0581361099e5ce68cbd9f457c /system/nvidia-driver/nvidia-switch | |
parent | cd90c74dab71b513b5432a8773f7573f72314414 (diff) |
system/nvidia-driver: added rc.nvidia-persistenced.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/nvidia-driver/nvidia-switch')
-rw-r--r-- | system/nvidia-driver/nvidia-switch | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch index 30f9a66cb0ef8..af2bd1770191e 100644 --- a/system/nvidia-driver/nvidia-switch +++ b/system/nvidia-driver/nvidia-switch @@ -1,6 +1,7 @@ #!/bin/sh # Copyright 2012-2019 Edward W. Koenig, Vancouver, WA, USA +# Updates copyright 2020 Lenard Spencer, Orlando, FL, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -20,26 +21,26 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# nvidia-switch utility 4.6 +# nvidia-switch utility 4.7.1 # -# 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. +# A tool to install and cleanly remove the nvidia driver without stomping +# on the mesa files. Note: this tool "should" allow switching on the fly, +# but why? Pick a driver! You will stilll need to edit a bunch of other +# config files. -# TO-DO: needs more cleanup, simplify linking using system tools, add 15.0 fixes - -ROOT="${ROOT:-/}" +# When ROOT=<PATH> is specified when using {install,upgrade,remove}pkg, +# PATH is usually specified without a trailing "/", so we need to add it +if [ "$ROOT" = "" ]; then + ROOT="${ROOT:-"/"}" +else + ROOT="${ROOT}/" +fi CWD=$(pwd) COMPAT32="LIB32FLAG" # This will be replaced in the build script (yes | no) LIBSUFFIX="LIBDIRSUFFIX" # This will be replaced in the build script INC="${ROOT}usr/include/GL" 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 -GL_VERSION="1.2.0" -GLVND="yes" # This will be replaced in the build script (yes | no) save_GL(){ # backup original mesa and xorg conflicts @@ -48,11 +49,13 @@ save_GL(){ "nvidia") mv libGL.la libGL.la-xorg mv libGL.la-nvidia libGL.la + /sbin/ldconfig ;; "xorg") mv libGL.la libGL.la-nvidia mv libGL.la-xorg libGL.la + /sbin/ldconfig ;; *) @@ -66,11 +69,12 @@ save_GL(){ nvidia_install(){ echo $'Installing to nvidia-driver files!\n' echo "Make sure the nvidia driver is ENABLED in /etc/X11/xorg.conf" - echo "and in /etc/X11/xorg.conf.d." - echo "Otherwise, this may lead to improperly working drivers." + echo "and/or in either /usr/share/X11/xorg.conf.d or" + echo "/etc/X11/xorg.conf.d. Otherwise, this may lead to improperly" + echo -e "working drivers.\n" save_GL "nvidia" $LIB - + # Check for multilib configuration if [ "$COMPAT32" = "yes" ]; then save_GL "nvidia" $LIB32 @@ -79,33 +83,29 @@ nvidia_install(){ nvidia_remove(){ echo $'Returning to stock xorg files!\n' - 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 "Make sure the nvidia driver is DISABLED in /etc/X11/xorg.conf" + echo "and in /usr/share/X11/xorg.conf.d and /etc/X11/xorg.conf.d." + echo "(Removing nvidia-kernelis recommended to accomplish this.)" echo "Otherwise, this may lead to improperly working drivers." + echo -e "\nPlease run /sbin/ldconfing after removing nvidia-driver." save_GL "xorg" $LIB # Check for multilib configuration if [ "$COMPAT32" = "yes" ]; then save_GL "xorg" $LIB32 fi - - if [ -e $NV_CONF ]; then - echo "You will need to remove/save $NV_CONF from nvidia-driver to use" - echo "any open source drivers." - fi } usage(){ echo "Usage:" - echo " --install Set up nvidia driver files (do not use!)" - echo " --remove Return to stock xorg files and restore all symlinks" + echo " --install Set up nvidia driver files and update symlinks" + echo " --remove Return to stock xorg files and restore symlinks" echo " --help Show this help message" } case "$1" in "--install") nvidia_install - ;; "--remove") nvidia_remove |