[openfabrics-ewg] [PATCH ofed-1.2 alpha rel] IB/iSER: fix open-iscsi uninstall

Erez Zilber erezz at voltaire.com
Tue Feb 13 04:35:22 PST 2007


Vlad,

The following patch fixes the uninstallation of open-iscsi (oiscsi does not exist anymore).

--- uninstall.sh.orig	2007-02-13 14:19:30.000000000 +0200
+++ uninstall.sh	2007-02-13 14:32:25.000000000 +0200
@@ -65,6 +65,23 @@
 MVAPICH_NAME="mvapich"
 PDSH_NAME="pdsh"
 
+if [ -f /etc/SuSE-release ]; then
+    DISTRIBUTION="SuSE"
+elif [ -f /etc/fedora-release ]; then
+    DISTRIBUTION="fedora"
+elif [ -f /etc/rocks-release ]; then
+    DISTRIBUTION="Rocks"
+elif [ -f /etc/redhat-release ]; then
+    DISTRIBUTION="redhat"
+elif [ -f /etc/debian_version ]; then
+    DISTRIBUTION="debian"
+else
+    DISTRIBUTION=$(ls /etc/*-release | head -n 1 | xargs -iXXX basename XXX -release 2> $NULL)
+    [ -z "${DISTRIBUTION}" ] && DISTRIBUTION="unsupported"
+fi
+
+OPEN_ISCSI_SUSE_NAME="open-iscsi"
+OPEN_ISCSI_REDHAT_NAME="iscsi-initiator-utils"
 
 # Execute the command $@ and check exit status
 ex()
@@ -89,16 +106,21 @@
     echo "Removing ${PACKAGE} Software installations"
     echo
 
-    OISCSI_LIST=$(rpm -qa | grep oiscsi)
-
-    if [ -n "$OISCSI_LIST" ]; then
-        for oiscsi_name in $OISCSI_LIST
-        do 
-            if ( $RPM -q ${oiscsi_name} > $NULL 2>&1 ); then
-                ex "$RPM -e ${oiscsi_name}"
-            fi
-        done    
-    fi
+    case ${DISTRIBUTION} in
+        SuSE)
+        if ( $RPM -q ${OPEN_ISCSI_SUSE_NAME} > $NULL 2>&1 ); then
+            ex "$RPM -e ${OPEN_ISCSI_SUSE_NAME}"
+        fi
+        ;;
+        redhat)
+        if ( $RPM -q ${OPEN_ISCSI_REDHAT_NAME} > $NULL 2>&1 ); then
+            ex "$RPM -e ${OPEN_ISCSI_REDHAT_NAME}"
+        fi
+        ;;
+        *)
+        echo "Error: Distribution ${DISTRIBUTION} is not supported by open-iscsi over iSER. Cannot uninstall open-iscsi"
+        ;;
+    esac
 
     MPITESTS_LIST=$(rpm -qa | grep mpitests)
 
-- 
____________________________________________________________

Erez Zilber   |  972-9-971-7689

Software Engineer, Storage Team

Voltaire – _The Grid Backbone_

 __

 www.voltaire.com <http://www.voltaire.com/>

<mailto:g at voltaire.com>

  






More information about the ewg mailing list