aboutsummaryrefslogtreecommitdiff
path: root/system/nvidia-driver/nvidia-switch
diff options
context:
space:
mode:
authorEdward W. Koenig <kingbeowulf@gmail.com>2017-07-10 05:03:28 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-07-12 22:48:09 +0700
commit7600256bae2e1265454e928cbac895ff9f47d83d (patch)
tree2a94c914c2f2a5ab0c4450cc612b70bb7fd0fea2 /system/nvidia-driver/nvidia-switch
parentc0fc3f1d6697766640f38d3fd5904386fc5e7edc (diff)
system/nvidia-driver: Fix nvidia-switch.
This includes Mario's patch and Gerardo's suggestion. Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/nvidia-driver/nvidia-switch')
-rw-r--r--system/nvidia-driver/nvidia-switch22
1 files changed, 14 insertions, 8 deletions
diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch
index 82eaf53932743..6c7a77cce0fa6 100644
--- a/system/nvidia-driver/nvidia-switch
+++ b/system/nvidia-driver/nvidia-switch
@@ -40,18 +40,20 @@ XLIB="$XMOD/extensions"
NV_VERSION="PKGVERSION" # This will be replaced in the build script
GL_VERSION="1.2.0"
GLVND="GLVNDFLAG" # This will be replaced in the build script (yes | no)
-NV_CONF="/usr/share/X11/xorg.conf.d/10-nvidia.conf"
-SAVELIBS="/var/log/nvidia"
+NV_CONF="${ROOT}usr/share/X11/xorg.conf.d/10-nvidia.conf"
+SAVELIBS="${ROOT}var/log/nvidia"
save_GL(){
-# backup original mesa and xorg conflicts to /var/lib/nvidia
+# backup original mesa and xorg conflicts to /var/log/nvidia
cd $2
+ # Need to make sure save path is reset incase of multilib
+ SAVELIBS="${ROOT}var/log/nvidia"
if [ "$2" = "$LIB32" ]; then
- SAVELIBS="/var/log/nvidia/32"
- fi
- if [ "$2" = "$LIB" ]; then
- SAVELIBS="/var/log/nvidia/64"
+ SAVELIBS="${SAVELIBS}/32"
+ elif [ "$2" = "$LIB" ]; then
+ SAVELIBS="${SAVELIBS}/64"
fi
+
case "$1" in
"nvidia")
@@ -151,6 +153,10 @@ save_wfb(){
}
nvidia_install(){
+ if [ ! -d $SAVELIBS ]; then
+ echo "Creating missing $SAVELIB ..."
+ mkdir -p $SAVELIBS
+ fi
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."
@@ -231,7 +237,7 @@ usage(){
echo " --restore Reinstall stock Mesa and xorg-server [EXPERIMENTAL]"
echo " mesa-11.2.2, org-server-1.18.3, and optionally"
echo " mesa-compat32-11.2.2 are expected in /root/Slackware"
- echo " Use 'PKGPATH="<location>" nvidia-switch --restore'"
+ echo " Use 'PKGPATH=\"<location>\" nvidia-switch --restore'"
echo " to override."
echo " --help Show this help message"
}