summaryrefslogtreecommitdiff
path: root/system/nvidia-driver/nvidia-switch
diff options
context:
space:
mode:
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 82eaf53932..6c7a77cce0 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"
}