From abca7c2558aca25e14063a1ec80776bb14bd684f Mon Sep 17 00:00:00 2001 From: "Edward W. Koenig" Date: Mon, 24 Nov 2014 08:20:05 +0700 Subject: system/nvidia-driver: Script cleanup. Signed-off-by: Willy Sudiarto Raharjo --- system/nvidia-driver/nvidia-switch | 57 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 29 deletions(-) (limited to 'system/nvidia-driver/nvidia-switch') diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch index 07f65f5358318..b33e532cec1d3 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(){ -- cgit v1.2.3