--- srptools-0.0.4.orig/debian/changelog +++ srptools-0.0.4/debian/changelog @@ -0,0 +1,27 @@ +srptools (0.0.4-1.2build1) raring; urgency=low + + * Rebuild against libibumad3. + + -- Colin Watson Fri, 11 Jan 2013 15:30:27 +0000 + +srptools (0.0.4-1.2) unstable; urgency=low + + * Non-maintainer upload. + * Drop debian/po which I inadvertenly left around + * Drop debconf and po-debconf build dependency + + -- Christian Perrier Fri, 23 Jul 2010 22:02:59 +0200 + +srptools (0.0.4-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix pending l10n issues by dropping the debconf note + Closes: #579193, #580573 + + -- Christian Perrier Tue, 20 Jul 2010 22:07:36 +0200 + +srptools (0.0.4-1) unstable; urgency=low + + * Initial release (Closes: #521424) + + -- Benoit Mortier Mon, 29 Mar 2010 18:51:00 +0100 --- srptools-0.0.4.orig/debian/rules +++ srptools-0.0.4/debian/rules @@ -0,0 +1,99 @@ +#!/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 + +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 --- srptools-0.0.4.orig/debian/srptools.postrm +++ srptools-0.0.4/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# --- srptools-0.0.4.orig/debian/srptools.default +++ srptools-0.0.4/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 --- srptools-0.0.4.orig/debian/compat +++ srptools-0.0.4/debian/compat @@ -0,0 +1 @@ +7 --- srptools-0.0.4.orig/debian/srptools.postinst +++ srptools-0.0.4/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# --- srptools-0.0.4.orig/debian/srptools-boot.init +++ srptools-0.0.4/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 --- srptools-0.0.4.orig/debian/control +++ srptools-0.0.4/debian/control @@ -0,0 +1,17 @@ +Source: srptools +Section: net +Priority: extra +Maintainer: OFED and Debian Developement and Discussion +Uploaders: Benoit Mortier , Guy Coates , Mario Lang +Build-Depends: debhelper (>= 7), autotools-dev, 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). --- srptools-0.0.4.orig/debian/README.debian +++ srptools-0.0.4/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" + --- srptools-0.0.4.orig/debian/copyright +++ srptools-0.0.4/debian/copyright @@ -0,0 +1,58 @@ +This package was debianized by Guy Coates 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@cisco.com + Vu Pham, vuhuong@mellanox.com + ishai Rabinovitz, ishai@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'. + --- srptools-0.0.4.orig/debian/docs +++ srptools-0.0.4/debian/docs @@ -0,0 +1,2 @@ +NEWS +README --- srptools-0.0.4.orig/debian/srptools.init +++ srptools-0.0.4/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