]> git.openfabrics.org - ~aditr/ofed_scripts.git/commitdiff
Updated uninstall.sh to remove empty mpi directories, /usr/mellanox, /usr/mst.
authorVladimir Sokolovsky <vlad@mellanox.co.il>
Wed, 19 Mar 2008 09:21:04 +0000 (11:21 +0200)
committerVladimir Sokolovsky <vlad@mellanox.co.il>
Wed, 19 Mar 2008 09:21:04 +0000 (11:21 +0200)
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
uninstall.sh

index 8bc432f4ba667ce7ebf8ce3253e9d298ca1f5754..aac134836e81ae3fd3e3865a6512ac9341cfc32a 100755 (executable)
@@ -187,29 +187,6 @@ uninstall()
             fi
         done    
     fi
-
-    if [[ ! -z $MTHOME && -d $MTHOME ]]; then
-        if [ -e $MTHOME/uninstall.sh ]; then
-            echo
-            echo "  An old version of the OPENIB driver was detected and will be removed now"
-            ex "yes | env MTHOME=$MTHOME $MTHOME/uninstall.sh"
-        else
-            echo
-            echo "Found an MTHOME variable pointing to $MTHOME. Probably some old InfiniBand Software ..."
-            echo
-        fi    
-        let RC++
-    elif [ -d /usr/mellanox ]; then
-        if [ -e /usr/mellanox/uninstall.sh ]; then
-            echo
-            echo "  Removing MVAPI..."
-            ex "yes | /usr/mellanox/uninstall.sh"
-        else
-            echo
-            echo "Found a /usr/mellanox directory. Probably some old InfiniBand Software ..."
-            echo
-        fi  
-    fi
     
     packs_to_remove=""
     for package in $ALL_PACKAGES $PREV_RELEASE_PACKAGES
@@ -233,6 +210,34 @@ uninstall()
         ex "$RPM -e --allmatches $packs_to_remove"
     fi
 
+    if [[ ! -z $MTHOME && -d $MTHOME ]]; then
+        if [ -e $MTHOME/uninstall.sh ]; then
+            echo
+            echo "  An old version of the OPENIB driver was detected and will be removed now"
+            ex "yes | env MTHOME=$MTHOME $MTHOME/uninstall.sh"
+        fi    
+        let RC++
+    elif [ -d /usr/mellanox ]; then
+        if [ -e /usr/mellanox/uninstall.sh ]; then
+            echo
+            echo "  Removing MVAPI..."
+            ex "yes | /usr/mellanox/uninstall.sh"
+        else
+            echo
+            echo "  Removing /usr/mellanox ..."
+            echo
+            /bin/rm -rf /usr/mellanox
+        fi  
+    fi
+
+    if [ -d /usr/mst ]; then
+        /bin/rm -rf /usr/mst
+    fi
+
+    if [ -z ${STACK_PREFIX} ] && [ -x /etc/infiniband/info ]; then
+        STACK_PREFIX=`/etc/infiniband/info | grep -w prefix | cut -d '=' -f 2`
+    fi
+
     # Remove /usr/local/ofed* if exist
     # BUG: https://bugs.openfabrics.org/show_bug.cgi?id=563
     if [ -d ${STACK_PREFIX} ]; then
@@ -243,6 +248,10 @@ uninstall()
         esac
     fi
 
+    if [ -d ${STACK_PREFIX}/mpi ]; then
+        find ${STACK_PREFIX}/mpi -type d | sort -r | xargs rmdir
+    fi
+
 #    # Uninstall SilverStorm package
 #    if [ -e /sbin/iba_config ]; then
 #        ex /sbin/iba_config -u