summaryrefslogtreecommitdiffstats
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-switch32
1 files changed, 9 insertions, 23 deletions
diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch
index 6765010fc7..5b7bd132ca 100644
--- a/system/nvidia-driver/nvidia-switch
+++ b/system/nvidia-driver/nvidia-switch
@@ -23,8 +23,8 @@
# nvidia-switch utility 2.0.0
#
# A tool to install and cleanly remove the nvidia driver without stomping on the xorg files.
-# Note: this tool no longer supports switching drivers "on the fly" only installing and uninstalling
-# the nvidia driver and restoring the original 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: Bounds/error checking, add COMPAT32
@@ -41,25 +41,6 @@ NV_VERSION='PKGVERSION' # This will be replaced in the build script
GL_VERSION="1.2"
NV_CONF="/usr/share/X11/xorg.conf.d/10-nvidia.conf"
-# Move, rename, restore files in /usr/include/GL
-incs(){
-cd "$INC"
-if [ "$1" = "xorg" ]; then
- for i in glxext.h glext.h glx.h gl.h; do
- rm -f "$i"
- mv "$i-xorg" "$i"
- done
-else
- for i in glxext.h glext.h glx.h gl.h; do
- if [ ! -e "$i-xorg" ]; then
- mv "$i" "$i-xorg"
- fi
- ln -sf "$i-nvidia" "$i"
- done
-fi
-cd "$CWD"
-}
-
save_GL(){
cd "$LIB"
if [ "$1" = "nvidia" ]; then
@@ -84,6 +65,7 @@ save_wfb(){
ln -sf libnvidia-wfb.so.$NV_VERSION-nvidia libnvidia-wfb.so.$NV_VERSION
ln -sf libnvidia-wfb.so.$NV_VERSION libnvidia-wfb.so.1
if [ ! -e libwfb.so ]; then
+ mv libwfb.so libwfb.so-xorg
ln -sf libnvidia-wfb.so.$NV_VERSION libwfb.so
fi
elif [ "$1" = "xorg" ]; then
@@ -91,7 +73,11 @@ save_wfb(){
rm -f libnvidia-wfb.so.1
if [ -L libwfb.so ]; then
rm -f libwfb.so
+ if [ -e libwfb.so-xorg ]; then
+ mv libwfb.so-xorg libwfb.so
+ fi
fi
+
fi
cd "$CWD"
}
@@ -125,7 +111,6 @@ nvidia_install(){
echo "Make sure the nvidia driver is ENABLED in /etc/X11/xorg.conf."
echo "Otherwise, this may lead to improperly working drivers."
- incs
save_GL "nvidia"
save_wfb "nvidia"
save_glx "nvidia"
@@ -138,13 +123,14 @@ 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 "Don't forget /usr/share/X11/xorg.conf.d/10-nvidia.conf if you use it!"
echo "Otherwise, this may lead to improperly working drivers."
- incs "xorg"
save_GL "xorg"
save_wfb "xorg"
save_glx "xorg"
+
if [ -e $NV_CONF ]; then
rm -f $NV_CONF
fi