aboutsummaryrefslogtreecommitdiff
path: root/system/nvidia-driver/nvidia-switch
diff options
context:
space:
mode:
authorLenard Spencer <lenardrspencer@gmail.com>2020-11-14 08:21:21 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-11-14 08:21:21 +0700
commit5711a98156e12f1c04fca8f1a782e2af9f218f76 (patch)
treeaff8bbfb636334be8ac252748aab353a368caf53 /system/nvidia-driver/nvidia-switch
parentce472bac6d683a95cd582a1976df21ccee298896 (diff)
system/nvidia-driver: Fix issue with .la handling.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/nvidia-driver/nvidia-switch')
-rw-r--r--system/nvidia-driver/nvidia-switch45
1 files changed, 25 insertions, 20 deletions
diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch
index e6d268f4bd95..9196cf7b8a8d 100644
--- a/system/nvidia-driver/nvidia-switch
+++ b/system/nvidia-driver/nvidia-switch
@@ -43,22 +43,20 @@ LIB="${ROOT}usr/lib${LIBSUFFIX}"
LIB32="${ROOT}usr/lib"
save_GL(){
-# backup original mesa conflict
+# backup original mesa conflicts
cd $2
case "$1" in
"nvidia")
- if [ -e libGL.la ]; then
- mv libGL.la libGL.la-xorg
- fi
- /sbin/ldconfig
+ cp libGL{,ES*}.la /var/log/nvidia/$3
+ mv libGL{.so.1.2.0,ESv1_CM.so.1.1.0,ESv2.so.2.0.0} /var/log/nvidia/$3
+ sed -i s/1.2.0/1.7.0/g libGL.la
+ sed -i s/1.1.0/1.2.0/g libGLESv1_CM.la
+ sed -i s/2.0.0/2.1.0/g libGLESv2.la
;;
"xorg")
- if [ -e libGL.la-xorg ]; then
- mv libGL.la-xorg libGL.la
- fi
- /sbin/ldconfig
- ;;
+ mv /var/log/nvidia/$3/* .
+ ;;
*)
echo "nothing to do for save_gl?"
@@ -75,11 +73,14 @@ nvidia_install(){
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
+ if [ "$LIBSUFFIX" = "64" ]; then
+ save_GL "nvidia" $LIB "64"
+ # Check for multilib configuration
+ if [ "$COMPAT32" = "yes" ]; then
+ save_GL "nvidia" $LIB32 "32"
+ fi
+ else
+ save_GL "nvidia" $LIB "32"
fi
}
@@ -88,12 +89,16 @@ nvidia_remove(){
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 "Otherwise, this may lead to improperly working drivers."
- echo -e "\nPlease run /sbin/ldconfing after removing nvidia-driver.\n"
+ echo -e "\nPLEASE run /sbin/ldconfing after removing nvidia-driver.\n"
- save_GL "xorg" $LIB
-# Check for multilib configuration
- if [ "$COMPAT32" = "yes" ]; then
- save_GL "xorg" $LIB32
+ if [ "$LIBSUFFIX" = "64" ]; then
+ save_GL "xorg" $LIB "64"
+ # Check for multilib configuration
+ if [ "$COMPAT32" = "yes" ]; then
+ save_GL "xorg" $LIB32 "32"
+ fi
+ else
+ save_GL "xorg" $LIB "32"
fi
}