[ewg] PATCH[1/2] Add stgt to ofed_1_4_scripts

Doron Shoham dorons at voltaire.com
Tue Jul 15 02:54:58 PDT 2008


Add stgt to ofed1.4 install/uninstall scripts

Signed-off-by: Doron Shoham <dorons at voltaire.com>
---
 install.pl   |   51 +++++++++++++++++++++++++++++++++++++++++++++++++--
 uninstall.sh |    8 ++++++++
 2 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/install.pl b/install.pl
index ac61400..72c7230 100755
--- a/install.pl
+++ b/install.pl
@@ -194,6 +194,8 @@ my @selected_kernel_modules = ();
 my $open_iscsi_ver_rh4 = '2.0-754.1';
 my $open_iscsi_ver_non_rh4 = '2.0-865.15.1';
 
+my $tgt_ver = '0.1-20080629';
+
 sub usage
 {
    print GREEN;
@@ -303,7 +305,7 @@ my @user_packages = ("libibverbs", "libibverbs-devel", "libibverbs-devel-static"
                      "perftest", "mstflint", "tvflash",
                      "qlvnictools", "sdpnetstat", "srptools", "rds-tools",
                      "ibutils", "infiniband-diags", "qperf", "qperf-debuginfo",
-                     "ofed-docs", "ofed-scripts", @mpi_packages
+                     "ofed-docs", "ofed-scripts", "tgt-generic", @mpi_packages
                      );
 
 my @basic_kernel_packages = ("kernel-ib");
@@ -1226,6 +1228,35 @@ my %packages_info = (
             ofa_req_inst => [],
             install32 => 0, exception => 0 },
 
+        'tgt-generic' =>
+            { name => ($distro eq 'SuSE') ? 'tgt': 'scsi-target-utils', parent => "tgt-generic",
+            selected => 0, installed => 0, rpm_exist => 0, rpm_exist32 => 0,
+            available => 1, mode => "user", dist_req_build => [],
+            dist_req_inst => [], ofa_req_build => ["libibverbs-devel", "librdmacm-devel"],
+            ofa_req_inst => ["librdmacm", "libibverbs-devel"],
+            install32 => 0, exception => 1, configure_options => '' },
+        'stgt' =>
+            { name => "stgt", parent => "tgt-generic",
+            selected => 0, installed => 0, rpm_exist => 0, rpm_exist32 => 0,
+            available => 1, mode => "user", dist_req_build => [],
+            dist_req_inst => [], ofa_req_build => ["libibverbs-devel", "librdmacm-devel"],
+            ofa_req_inst => ["librdmacm", "libibverbs-devel"],
+            install32 => 0, exception => 1 },
+        'tgt' =>
+            { name => "tgt", parent => "tgt-generic",
+            selected => 0, installed => 0, rpm_exist => 0, rpm_exist32 => 0,
+            available => 1, mode => "user", dist_req_build => [],
+            dist_req_inst => [], ofa_req_build => ["libibverbs-devel", "librdmacm-devel"],
+            ofa_req_inst => ["librdmacm", "libibverbs-devel"],
+            install32 => 0, exception => 1 },
+        'scsi-target-utils' =>
+            { name => "scsi-target-utils", parent => "tgt-generic",
+            selected => 0, installed => 0, rpm_exist => 0, rpm_exist32 => 0,
+            available => 1, mode => "user", dist_req_build => [],
+            dist_req_inst => [], ofa_req_build => ["libibverbs-devel", "librdmacm-devel"],
+            ofa_req_inst => ["librdmacm", "libibverbs-devel"],
+            install32 => 0, exception => 1 },
+
         'ofed-docs' =>
             { name => "ofed-docs", parent => "ofed-docs",
             selected => 0, installed => 0, rpm_exist => 0, rpm_exist32 => 0,
@@ -1591,6 +1622,11 @@ sub set_availability
             $packages_info{'open-iscsi-generic'}{'available'} = 1;
     }
 
+    # tgt
+    if ($kernel =~ m/2.6.16.[0-9.]*-[0-9.]*-[A-Za-z0-9.]*|el5/) {
+            $packages_info{'tgt-generic'}{'available'} = 1;
+    }
+
     # QLogic vnic
     if ($kernel =~ m/2.6.9-42|2.6.9-55|2.6.9-67|2.6.16.[0-9.]*-[0-9.]*-[A-Za-z0-9.]*|2.6.18-*/) {
             $kernel_modules_info{'qlgc_vnic'}{'available'} = 1;
@@ -2081,6 +2117,14 @@ sub select_packages
                     next;
                 }
 
+                if ($package eq "stgt") {
+                    if ( $selected eq 'y' ) {
+                       push (@selected_by_user, "tgt-generic");
+                       print "select_package: selected tgt-generic\n" if ($verbose2);
+                       $cnt ++;
+                       next;
+                    }
+                }
 
 		if (substr($package,0,length("vendor_config")) eq "vendor_config") {
 		       next;
@@ -2273,6 +2317,9 @@ sub select_packages
             check_open_iscsi();
             push (@selected_by_user, "open-iscsi-generic");
         }
+        if ("stgt" =~ m/$tmp/) {
+            push (@selected_by_user, "tgt-generic");
+        }
         flock CONFIG, $UNLOCK;
     }
     close(CONFIG);
@@ -3695,7 +3742,7 @@ sub install
                 install_rpm($package);
             }
             else {
-                if ($package eq "open-iscsi-generic") {
+                if (($package eq "open-iscsi-generic") || ($package eq "tgt-generic")) {
                     my $real_name = $packages_info{$package}{'name'};
                     if (not $packages_info{$real_name}{'rpm_exist'}) {
                         build_rpm($real_name);
diff --git a/uninstall.sh b/uninstall.sh
index 7c8aa9c..4d3eab9 100755
--- a/uninstall.sh
+++ b/uninstall.sh
@@ -113,6 +113,8 @@ fi
 
 OPEN_ISCSI_SUSE_NAME="open-iscsi"
 OPEN_ISCSI_REDHAT_NAME="iscsi-initiator-utils"
+STGT_SUSE_NAME="tgt"
+STGT_REDHAT_NAME="scsi-target-utils"
 
 # Execute the command $@ and check exit status
 ex()
@@ -142,11 +144,17 @@ uninstall()
         if ( $RPM -q ${OPEN_ISCSI_SUSE_NAME} > $NULL 2>&1 ) && ( $RPM --queryformat "[%{VENDOR}]" -q ${OPEN_ISCSI_SUSE_NAME} | grep -i Voltaire > $NULL 2>&1 ); then
             packs_to_remove="$packs_to_remove ${OPEN_ISCSI_SUSE_NAME}"
         fi
+        if ( $RPM -q ${STGT_SUSE_NAME} > $NULL 2>&1 ) && ( $RPM --queryformat "[%{VENDOR}]" -q ${STGT_SUSE_NAME} | grep -i Voltaire > $NULL 2>&1 ); then
+            packs_to_remove="$packs_to_remove ${STGT_SUSE_NAME}"
+        fi
         ;;
         redhat)
         if ( $RPM -q ${OPEN_ISCSI_REDHAT_NAME} > $NULL 2>&1 ) && ( $RPM --queryformat "[%{VENDOR}]" -q ${OPEN_ISCSI_REDHAT_NAME} | grep -i Voltaire > $NULL 2>&1 ); then
             packs_to_remove="$packs_to_remove ${OPEN_ISCSI_REDHAT_NAME}"
         fi
+        if ( $RPM -q ${STGT_REDHAT_NAME} > $NULL 2>&1 ) && ( $RPM --queryformat "[%{VENDOR}]" -q ${STGT_REDHAT_NAME} | grep -i Voltaire > $NULL 2>&1 ); then
+            packs_to_remove="$packs_to_remove ${STGT_REDHAT_NAME}"
+        fi
         ;;
         *)
         echo "Error: Distribution ${DISTRIBUTION} is not supported by open-iscsi over iSER. Cannot uninstall open-iscsi"
-- 
1.5.3.8





More information about the ewg mailing list