[Pkg-ofed-commits] [srptools] 02/04: Imported Debian patch 0.0.4-1

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Wed Jul 2 14:41:49 UTC 2014


This is an automated email from the git hooks/post-receive script.

ana pushed a commit to branch master
in repository srptools.

commit 145fda2c03ec89400f77af14e6602cf945acad47
Author: Benoit Mortier <benoit.mortier at opensides.be>
Date:   Mon Mar 29 18:51:00 2010 +0100

    Imported Debian patch 0.0.4-1
---
 debian/README.debian      |  42 +++++++++++++++++++
 debian/changelog          |   5 +++
 debian/compat             |   1 +
 debian/control            |  17 ++++++++
 debian/copyright          |  58 +++++++++++++++++++++++++++
 debian/docs               |   2 +
 debian/po/POTFILES.in     |   1 +
 debian/po/templates.pot   |  32 +++++++++++++++
 debian/rules              | 100 ++++++++++++++++++++++++++++++++++++++++++++++
 debian/srptools-boot.init |  82 +++++++++++++++++++++++++++++++++++++
 debian/srptools.config    |   8 ++++
 debian/srptools.default   |  14 +++++++
 debian/srptools.init      |  90 +++++++++++++++++++++++++++++++++++++++++
 debian/srptools.postinst  |  11 +++++
 debian/srptools.postrm    |   9 +++++
 debian/srptools.templates |   6 +++
 16 files changed, 478 insertions(+)

diff --git a/debian/README.debian b/debian/README.debian
new file mode 100644
index 0000000..8cd690f
--- /dev/null
+++ b/debian/README.debian
@@ -0,0 +1,42 @@
+Configuring srp_daemon
+----------------------
+
+In order to configure the srp_daemon you must list the
+IB ports you want to use in /etc/defaults/srptools.
+
+If you add ports which do not have srp devices presented
+to them, srp_daemon will hang, causing the boot process
+to hang.
+
+IB ports are listed in the form:
+
+"Channel Adapter":"port number"
+
+You can list all the Channel Adapters (CAs) and ports with the ibstatus 
+command. The CA is listed as the Infiniband device.
+
+eg, to configure srp_daemon on all the ports listed below:
+
+
+#ibstatus 
+Infiniband device 'mlx4_0' port 1 status:
+        default gid:     fe80:0000:0000:0000:0002:c903:0002:fce9
+        base lid:        0x22
+        sm lid:          0x1
+        state:           4: ACTIVE
+        phys state:      5: LinkUp
+        rate:            20 Gb/sec (4X DDR)
+
+Infiniband device 'mlx4_0' port 2 status:
+        default gid:     fe80:0000:0000:0000:0002:c903:0002:fcea
+        base lid:        0x0
+        sm lid:          0x0
+        state:           1: DOWN
+        phys state:      2: Polling
+        rate:            10 Gb/sec (4X)
+
+
+set:
+
+IB_PORTS="mlx4_0:1 mlx4_0:2"
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..13a265e
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+srptools (0.0.4-1) unstable; urgency=low
+
+  * Initial release (Closes: #521424)
+
+ -- Benoit Mortier <benoit.mortier at opensides.be>  Mon, 29 Mar 2010 18:51:00 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..c8e6a0a
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,17 @@
+Source: srptools
+Section: net
+Priority: extra
+Maintainer: OFED and Debian Developement and Discussion <pkg-ofed-devel at lists.alioth.debian.org>
+Uploaders: Benoit Mortier <benoit.mortier at opensides.be>, Guy Coates <gmpc at sanger.ac.uk>, Mario Lang <mlang at debian.org>
+Build-Depends: debhelper (>= 7), autotools-dev, debconf, po-debconf, libibcommon-dev, libibumad-dev, libibverbs-dev
+Standards-Version: 3.8.4
+Homepage: http://www.openfabrics.org
+DM-Upload-Allowed: yes
+
+Package: srptools
+Architecture: i386 ia64 amd64 powerpc
+Depends: ${shlibs:Depends}, ${misc:Depends}, infiniband-diags
+Description: Tools for Infiniband attached storage (SRP)
+ In conjunction with the kernel ib_srp driver, srptools allows you to
+ discover and use Infiniband attached storage devices which use the 
+ SCSI RDMA Protocol (SRP).
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..7a16a3f
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,58 @@
+This package was debianized by Guy Coates <gmpc at sanger.ac.uk> on
+Fri, 09 Jan 2009 13:07:23 +0000.
+
+It was downloaded from http://www.openfabrics.org/downloads/OFED/ofed-1.4/OFED-1.4.tgz
+
+
+Upstream Authors:
+ Roland Dreier, rdreir at cisco.com
+ Vu Pham, vuhuong at mellanox.com
+ ishai Rabinovitz, ishai at mellanox.co.il
+
+Copyright:
+
+Copyright (c) 2006 Mellanox Technologies. All rights reserved.
+Copyright (c) 2005 Topspin Communications.  All rights reserved.
+Copyright (c) 2006 Cisco Systems, Inc.  All rights reserved.
+Copyright (c) 2005 Voltaire, Inc. All rights reserved.
+
+License:
+
+ This software is available to you under a choice of one of two
+ licenses.  You may choose to be licensed under the terms of the GNU
+ General Public License (GPL) Version 2, available from the file
+ /usr/share/common-licenses/GPL-2 on your debian system or the 
+ OpenIB.org BSD license below:
+
+
+                       OpenIB.org BSD license
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above
+    copyright notice, this list of conditions and the following
+    disclaimer in the documentation and/or other materials provided
+    with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+The Debian packaging is Copyright (C) 2009, Genome Research Ltd  and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
+
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..50bd824
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,2 @@
+NEWS
+README
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
new file mode 100644
index 0000000..23759f8
--- /dev/null
+++ b/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] srptools.templates
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
new file mode 100644
index 0000000..e249fed
--- /dev/null
+++ b/debian/po/templates.pot
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: srptools at packages.debian.org\n"
+"POT-Creation-Date: 2009-01-26 14:35+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <LL at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: note
+#. Description
+#: ../srptools.templates:1001
+msgid "srp_daemon is disabled by default"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../srptools.templates:1001
+msgid ""
+"You must configure the IB ports for srp_daemon to listen on in /etc/default/"
+"srptools. Note that starting the daemon on a port which does not have any "
+"srp devices presented will cause the boot process to hang."
+msgstr ""
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..befd96c
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,100 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+else
+CROSS= --build $(DEB_BUILD_GNU_TYPE)
+endif
+
+
+
+config.status: configure
+	dh_testdir
+	# Add here commands to configure the package.
+ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+	cp -f /usr/share/misc/config.sub config.sub
+endif
+ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+	cp -f /usr/share/misc/config.guess config.guess
+endif
+	./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" \
+	 --sysconfdir=/etc
+
+
+build: build-stamp
+
+build-stamp:  config.status 
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+	#docbook-to-man debian/srptools.sgml > srptools.1
+
+	touch $@
+
+clean: 
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp 
+
+	# Add here commands to clean up after the build process.
+	[ ! -f Makefile ] || $(MAKE) distclean
+	rm -f config.sub config.guess
+
+	dh_clean 
+	debconf-updatepo
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep  
+	dh_installdirs
+
+	# Add here commands to install the package into debian/srptools.
+	$(MAKE) DESTDIR=$(CURDIR)/debian/srptools install
+	mkdir -p $(CURDIR)/debian/srptools/etc/init.d
+	cp $(CURDIR)/debian/srptools-boot.init $(CURDIR)/debian/srptools/etc/init.d/srptools-boot
+	rm  $(CURDIR)/debian/srptools/usr/sbin/srp_daemon.sh
+	rm  $(CURDIR)/debian/srptools/usr/sbin/run_srp_daemon
+
+# Build architecture-independent files here.
+binary-indep: install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs ChangeLog
+	dh_installdocs
+	dh_installexamples
+#	dh_install --list-missing
+	dh_installdebconf
+	dh_installinit
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install 
diff --git a/debian/srptools-boot.init b/debian/srptools-boot.init
new file mode 100644
index 0000000..97658df
--- /dev/null
+++ b/debian/srptools-boot.init
@@ -0,0 +1,82 @@
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides:          srptools-boot
+# Required-Start:    $remote_fs    
+# Required-Stop:     
+# Default-Start:     S
+# Default-Stop:      
+# Short-Description: Onetime Discovery of  SRP scsi targets.
+# Description:       Discovers SRP scsi over infiniband targets during boot.
+### END INIT INFO
+
+[ -x /usr/sbin/srp_daemon ] || exit 0
+
+IBDIR=/sys/class/infiniband
+
+PORTS=""
+RETRIES=""
+LOG=""
+
+[ -f /etc/default/srptools ] &&  . /etc/default/srptools
+
+start_daemon () {
+
+if [ "$PORTS" = "NONE" ] ; then
+echo "srptools disabled."
+exit 0
+fi
+
+echo -n "Waiting for fabric to settle..."
+sleep 1
+echo "done"
+
+if [ "$PORTS" = "ALL" ]  ; then
+    for HCA_ID in `/bin/ls -1 ${IBDIR}`
+      do
+      for PORT in `/bin/ls -1 ${IBDIR}/${HCA_ID}/ports/`
+        do
+	run_daemon
+      done
+    done
+fi
+
+
+for ADAPTER in $PORTS ; do
+    HCA_ID=`echo $ADAPTER | awk -F: '{print $1}'`
+    PORT=`echo $ADAPTER | awk -F:  '{print $2}'`
+    run_daemon
+done
+}
+
+
+run_daemon() {
+# SRP deamon wedges if we start it on a port which is not up
+
+	STATUS=`/usr/sbin/ibstat $HCA_ID $PORT | grep "State:"`
+
+	if [ "$STATUS" = "State: Active" ] ; then
+	    echo "Running  srp scan on $HCA_ID $PORT"
+# Run in 1 shot mode
+/usr/sbin/srp_daemon -o -e -c -n -i ${HCA_ID} -p ${PORT}
+	    RETVAL=$?
+	fi
+}
+
+stop_daemon () {
+    echo
+}
+
+
+case "$1" in 
+
+start)
+start_daemon
+;;
+stop)
+stop_daemon
+;;
+restart | reload | force-reload )
+stop_daemon
+start_daemon
+;;
+esac
diff --git a/debian/srptools.config b/debian/srptools.config
new file mode 100644
index 0000000..40eb479
--- /dev/null
+++ b/debian/srptools.config
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_input high srptools/warning || true
+db_go || true
diff --git a/debian/srptools.default b/debian/srptools.default
new file mode 100644
index 0000000..8bba3e6
--- /dev/null
+++ b/debian/srptools.default
@@ -0,0 +1,14 @@
+#How often should srpdeamon  rescan the fabric (seconds)
+RETRIES=60
+
+#Where should srp-deamon log to
+LOG=/var/log/srp_daemon.log
+
+# What ports should srp-deamon be started on.
+# Format is CA:port
+# ALL or NONE will run on all ports on none
+# respectively
+
+PORTS=NONE
+#PORTS=ALL
+#PORTS="mthca0:1 mlx4_0:2"
\ No newline at end of file
diff --git a/debian/srptools.init b/debian/srptools.init
new file mode 100644
index 0000000..cd3ef10
--- /dev/null
+++ b/debian/srptools.init
@@ -0,0 +1,90 @@
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides:          srptools
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Discovers SRP scsi targets.
+# Description:       Discovers SRP scsi over infiniband targets.
+### END INIT INFO
+
+[ -x /usr/sbin/srp_daemon ] || exit 0
+
+IBDIR=/sys/class/infiniband
+
+PORTS=""
+RETRIES=""
+LOG=""
+
+[ -f /etc/default/srptools ] &&  . /etc/default/srptools
+
+start_daemon () {
+
+if [ "$PORTS" = "NONE" ] ; then
+echo "srptools disabled."
+exit 0
+fi
+
+
+if [ "$PORTS" = "ALL" ]  ; then
+    for HCA_ID in `/bin/ls -1 ${IBDIR}`
+      do
+      for PORT in `/bin/ls -1 ${IBDIR}/${HCA_ID}/ports/`
+        do
+        run_daemon
+      done
+    done
+fi
+
+
+for ADAPTER in $PORTS ; do
+    HCA_ID=`echo $ADAPTER | awk -F: '{print $1}'`
+    PORT=`echo $ADAPTER | awk -F:  '{print $2}'`
+    run_daemon
+done
+}
+
+
+run_daemon() {
+# SRP deamon wedges if we start it on a port which is not up
+
+        STATUS=`/usr/sbin/ibstat $HCA_ID $PORT | grep "State:"`
+
+        if [ "$STATUS" = "State: Active" ] ; then
+            echo "Starting srp on $HCA_ID $PORT"
+
+# srp does not background itself; using the start-stop-daemon background function                                   
+                                                                               # causes us to lose stdout, which is 
+where it logs to .                         
+            nohup start-stop-daemon --start --quiet -m --pidfile /var/run/srp_daemon.${HCA_ID}.${PORT} \
+            --exec  /usr/sbin/srp_daemon -- -e -c -n -i ${HCA_ID} -p ${PORT} -R ${RETRIES}   >> $LOG 2>&1 &
+            RETVAL=$?
+        fi
+}
+
+stop_daemon () {
+     for HCA_ID in `/bin/ls -1 ${IBDIR}`
+      do
+      for PORT in `/bin/ls -1 ${IBDIR}/${HCA_ID}/ports/`
+        do
+        start-stop-daemon --stop --quiet --oknodo -m --pidfile /var/run/srp_daemon.${HCA_ID}.${PORT} 
+        RETVAL=$?
+      done
+    done
+}
+
+
+case "$1" in 
+
+start)
+start_daemon
+;;
+stop)
+stop_daemon
+;;
+restart | reload | force-reload )
+stop_daemon
+start_daemon
+;;
+esac
diff --git a/debian/srptools.postinst b/debian/srptools.postinst
new file mode 100644
index 0000000..e2ddfac
--- /dev/null
+++ b/debian/srptools.postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -x "/etc/init.d/srptools-boot" ]; then
+update-rc.d srptools-boot start 24 S . > /dev/null
+fi
+
+#DEBHELPER#
diff --git a/debian/srptools.postrm b/debian/srptools.postrm
new file mode 100644
index 0000000..3465540
--- /dev/null
+++ b/debian/srptools.postrm
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "purge" ] ; then
+        update-rc.d srptools-boot remove >/dev/null || exit $?
+fi
+
+#DEBHELPER#
diff --git a/debian/srptools.templates b/debian/srptools.templates
new file mode 100644
index 0000000..2a20558
--- /dev/null
+++ b/debian/srptools.templates
@@ -0,0 +1,6 @@
+Template: srptools/warning
+Type: note
+_Description: srp_daemon is disabled by default
+ You must configure the IB ports for srp_daemon to listen on in
+ /etc/default/srptools. Note that starting the daemon on a port which does
+ not have any srp devices presented will cause the boot process to hang.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/srptools.git



More information about the Pkg-ofed-commits mailing list