summaryrefslogtreecommitdiff
path: root/system/nvidia-driver/nvidia-switch
diff options
context:
space:
mode:
authorEdward W. Koenig <kingbeowulf@gmail.com>2014-11-24 08:20:05 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-11-24 08:20:05 +0700
commitabca7c2558aca25e14063a1ec80776bb14bd684f (patch)
tree468df1d504ecd7ef886fec78af949967f52b1e98 /system/nvidia-driver/nvidia-switch
parent15bbae439167fc86240d86c5ff78aaf8c77edb25 (diff)
downloadslackbuilds-abca7c2558aca25e14063a1ec80776bb14bd684f.tar.gz
system/nvidia-driver: Script cleanup.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/nvidia-driver/nvidia-switch')
-rw-r--r--system/nvidia-driver/nvidia-switch57
1 files changed, 28 insertions, 29 deletions
diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch
index 07f65f5358..b33e532cec 100644
--- a/system/nvidia-driver/nvidia-switch
+++ b/system/nvidia-driver/nvidia-switch
@@ -49,16 +49,18 @@ save_GL(){
if [ ! -e libGL.so.$GL_VERSION-xorg ]; then
mv libGL.so.$GL_VERSION libGL.so.$GL_VERSION-xorg
fi
- ln -sf libGL.so.$NV_VERSION-nvidia libGL.so.$NV_VERSION
+ mv libGL.so.$NV_VERSION-nvidia libGL.so.$NV_VERSION
ln -sf libGL.so.$NV_VERSION libGL.so.1
ln -sf libGL.so.$NV_VERSION libGL.so
fi
if [ "$1" = "xorg" ]; then
- mv libGL.so.$GL_VERSION-xorg libGL.so.$GL_VERSION
- ln -sf libGL.so.$GL_VERSION libGL.so.1
- ln -sf libGL.so.$GL_VERSION libGL.so
- rm -f libGL.so.$NV_VERSION
+ if [ -e libGL.so.$GL_VERSION-xorg ]; then
+ mv libGL.so.$GL_VERSION-xorg libGL.so.$GL_VERSION
+ ln -sf libGL.so.$GL_VERSION libGL.so.1
+ ln -sf libGL.so.$GL_VERSION libGL.so
+ fi
+ mv libGL.so.$NV_VERSION libGL.so.$NV_VERSION-nvidia
fi
cd "$CWD"
}
@@ -66,14 +68,14 @@ save_GL(){
save_wfb(){
cd "$XMOD"
if [ "$1" = "nvidia" ]; then
- ln -sf libnvidia-wfb.so.$NV_VERSION-nvidia libnvidia-wfb.so.$NV_VERSION
+ mv 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
- rm -f libnvidia-wfb.so.$NV_VERSION
+ mv libnvidia-wfb.so.$NV_VERSION libnvidia-wfb.so.$NV_VERSION-nvidia
rm -f libnvidia-wfb.so.1
if [ -L libwfb.so ]; then
rm -f libwfb.so
@@ -105,24 +107,25 @@ cd "$CWD"
multilib(){
# rejigger multilib paths/links
- cd $LIB32
- case "$1" in
- "nvidia")
- if [ ! -e libGL.so.$GL_VERSION-xorg ]; then
- mv libGL.so.$GL_VERSION libGL.so.$GL_VERSION-xorg
- fi
- ln -sf libGL.so.$NV_VERSION-nvidia libGL.so.$NV_VERSION
- ln -sf libGL.so.$NV_VERSION libGL.so.1
- ln -sf libGL.so.$NV_VERSION libGL.so
- ;;
- "xorg")
- mv libGL.so.$GL_VERSION-xorg libGL.so.$GL_VERSION
- ln -sf libGL.so.$GL_VERSION libGL.so.1
- ln -sf libGL.so.$GL_VERSION libGL.so
- rm -f libGL.so.$NV_VERSION
- ;;
- esac
- cd "$CWD"
+ cd $LIB32
+ if [ "$1" = "nvidia" ]; then
+ if [ ! -e libGL.so.$GL_VERSION-xorg ]; then
+ mv libGL.so.$GL_VERSION libGL.so.$GL_VERSION-xorg
+ fi
+ mv libGL.so.$NV_VERSION-nvidia libGL.so.$NV_VERSION
+ ln -sf libGL.so.$NV_VERSION libGL.so.1
+ ln -sf libGL.so.$NV_VERSION libGL.so
+ fi
+
+ if [ "$1" = "xorg" ]; then
+ if [ -e libGL.so.$GL_VERSION-xorg ]; then
+ mv libGL.so.$GL_VERSION-xorg libGL.so.$GL_VERSION
+ ln -sf libGL.so.$GL_VERSION libGL.so.1
+ ln -sf libGL.so.$GL_VERSION libGL.so
+ fi
+ mv libGL.so.$NV_VERSION libGL.so.$NV_VERSION-nvidia
+ fi
+ cd "$CWD"
}
nvidia_ldconfig(){
@@ -147,8 +150,6 @@ nvidia_install(){
LD_NVIDIA="${LIB}/libGL.so.$NV_VERSION"
nvidia_ldconfig $LD_NVIDIA
- WFB-NVIDIA="${XMOD}/libnvidia_wfb.so.$NV_VERSION"
- nvidia_ldconfig $WFB_NVIDIA
}
nvidia_remove(){
@@ -171,8 +172,6 @@ nvidia_remove(){
LD_NVIDIA="${LIB}/libGL.so.$GL_VERSION"
nvidia_ldconfig $LD_NVIDIA
- WFB-NVIDIA="${XMOD}/libwfb.so"
- nvidia_ldconfig $WFB_NVIDIA
}
usage(){