diff options
Diffstat (limited to 'system/nvidia-driver/nvidia-switch')
-rw-r--r-- | system/nvidia-driver/nvidia-switch | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch index e40d264801..68d9d4acea 100644 --- a/system/nvidia-driver/nvidia-switch +++ b/system/nvidia-driver/nvidia-switch @@ -20,13 +20,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# nvidia-switch utility 2.3 +# nvidia-switch utility 2.4 # # A tool to install and cleanly remove the nvidia driver without stomping on the 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: needs cleanup; too "wordy" and brittle. +# TO-DO: needs cleanup; too brittle. set -e @@ -46,17 +46,17 @@ NV_CONF="/usr/share/X11/xorg.conf.d/10-nvidia.conf" save_GL(){ cd $2 if [ "$1" = "nvidia" ]; then - if [ ! -e libGL.so.$GL_VERSION-xorg ]; then + if [ -e libGL.so.$GL_VERSION ]; then mv libGL.so.$GL_VERSION libGL.so.$GL_VERSION-xorg mv libGL.la libGL.la-xorg fi mv libGL.so.$NV_VERSION-nvidia libGL.so.$NV_VERSION + mv libGL.la-nvidia libGL.la ln -sf libGL.so.$NV_VERSION libGL.so.1 ln -sf libGL.so.$NV_VERSION libGL.so - if [ ! -e libEGL.so.1.0.0-xorg ]; then + if [ -e libEGL.so.1.0.0 ]; then mv libEGL.so.1.0.0 libEGL.so.1.0.0-xorg fi - mv libGL.la-nvidia libGL.la mv libEGL.so.$NV_VERSION-nvidia libEGL.so.$NV_VERSION ln -sf libEGL.so.$NV_VERSION libEGL.so.1.0.0 ln -sf libEGL.so.$NV_VERSION libEGL.so.1 @@ -71,8 +71,6 @@ save_GL(){ ln -sf libGL.so.$GL_VERSION libGL.so.1 ln -sf libGL.so.$GL_VERSION libGL.so mv libGL.la-xorg libGL.la - else - echo WARNING: libGL.so is missing. fi mv libEGL.so.$NV_VERSION libEGL.so.$NV_VERSION-nvidia if [ -e libEGL.so.1.0.0-xorg ]; then @@ -137,6 +135,12 @@ nvidia_remove(){ # Check for multilib configuration if [ "$COMPAT32" = "yes" ]; then save_GL "xorg" $LIB32 +# remove dangling symlinks + rm -f $LIB32/libGLESv1_CM.so.1 + rm -f $LIB32/libGLESv2.so.2 + rm -f $LIB32/libnvidia*.so.1 + rm -f $LIB32/libvdpau-nvidia.so.1 + rm -f $LIB32/libcuda.so.1 fi if [ -e $NV_CONF ]; then @@ -146,9 +150,12 @@ nvidia_remove(){ # LD_NVIDIA="${LIB}/libGL.so.$GL_VERSION" # nvidia_ldconfig $LD_NVIDIA # screws up multilub /usr/lib links? -# Kill two dangling libGLES symlinks; check next mesa version for presence. - rm -f /usr/lib64/libGLESv1_CM.so.1 - rm -f /usr/lib64/libGLESv2.so.2 +# Kill two dangling symlinks; check next mesa version for libGLES presence. + rm -f $LIB/libGLESv1_CM.so.1 + rm -f $LIB/libGLESv2.so.2 + rm -f $LIB/libnvidia*.so.1 + rm -f $LIB/libvdpau-nvidia.so.1 + rm -f $LIB/libcuda.so.1 } usage(){ |