summaryrefslogtreecommitdiff
path: root/network/iscsitarget
diff options
context:
space:
mode:
Diffstat (limited to 'network/iscsitarget')
-rw-r--r--network/iscsitarget/README9
-rw-r--r--network/iscsitarget/doinst.sh2
-rw-r--r--network/iscsitarget/iscsitarget-0.4.17-2.6.29.patch79
-rw-r--r--network/iscsitarget/iscsitarget-0.4.17-add_OPTS_cflags.patch9
-rw-r--r--network/iscsitarget/iscsitarget.SlackBuild60
-rw-r--r--network/iscsitarget/iscsitarget.info2
-rw-r--r--network/iscsitarget/rc.iscsi-target91
-rw-r--r--network/iscsitarget/slack-desc2
8 files changed, 234 insertions, 20 deletions
diff --git a/network/iscsitarget/README b/network/iscsitarget/README
index 6be0cad246..20a52e1e95 100644
--- a/network/iscsitarget/README
+++ b/network/iscsitarget/README
@@ -1,4 +1,5 @@
-iSCSI Enterprise Target is for building an iSCSI storage system on
-Linux.
-
-This package makes all bindings that are supported on the system.
+The aim of the project is to develop an open source iSCSI target with
+professional features, that works well in enterprise environment under
+real workload, and is scalable and versatile enough to meet the challenge
+of future storage needs and developments. This package makes all bindings
+that are supported on the system.
diff --git a/network/iscsitarget/doinst.sh b/network/iscsitarget/doinst.sh
index e02c47b197..09c804906d 100644
--- a/network/iscsitarget/doinst.sh
+++ b/network/iscsitarget/doinst.sh
@@ -25,5 +25,5 @@ config etc/initiators.deny.new
config etc/initiators.allow.new
config etc/ietd.conf.new
-chroot . depmod -a 2>/dev/null 1>/dev/null
+chroot . depmod -a @KERNEL@ 2>/dev/null 1>/dev/null
diff --git a/network/iscsitarget/iscsitarget-0.4.17-2.6.29.patch b/network/iscsitarget/iscsitarget-0.4.17-2.6.29.patch
new file mode 100644
index 0000000000..3c222d35b5
--- /dev/null
+++ b/network/iscsitarget/iscsitarget-0.4.17-2.6.29.patch
@@ -0,0 +1,79 @@
+Fix build with 2.6.29.
+
+Addresses these changes:
+http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=30c40d2c01f68c7eb1a41ab3552bdaf5dbf300d4;hp=9a1c3542768b5a58e45a9216921cd10a3bae1205
+http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b189db5d299c6824780af5590564ff608adb3dea;hp=a20fd0a783551831bb6b9b69710e5bbb93dc2730
+Lubomir Rintel <lkundrak@v3.sk>
+
+Index: kernel/block-io.c
+===================================================================
+--- kernel/block-io.c (revision 198)
++++ kernel/block-io.c (working copy)
+@@ -13,6 +13,7 @@
+ #include <linux/blkdev.h>
+ #include <linux/parser.h>
+ #include <linux/buffer_head.h>
++#include <linux/version.h>
+
+ #include "iscsi.h"
+ #include "iscsi_dbg.h"
+@@ -154,14 +155,22 @@
+ {
+ struct blockio_data *bio_data = volume->private;
+ struct block_device *bdev;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+ int flags = LUReadonly(volume) ? MS_RDONLY : 0;
++#else
++ fmode_t flags = LUReadonly(volume) ? FMODE_READ : (FMODE_READ | FMODE_WRITE);
++#endif
+ int err = 0;
+
+ bio_data->path = kstrdup(path, GFP_KERNEL);
+ if (!bio_data->path)
+ return -ENOMEM;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+ bdev = open_bdev_excl(path, flags, THIS_MODULE);
++#else
++ bdev = open_bdev_exclusive(path, flags, THIS_MODULE);
++#endif
+ if (IS_ERR(bdev)) {
+ err = PTR_ERR(bdev);
+ eprintk("Can't open device %s, error %d\n", path, err);
+@@ -324,8 +333,17 @@
+ {
+ struct blockio_data *bio_data = volume->private;
+
+- if (bio_data->bdev)
++ if (bio_data->bdev) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+ close_bdev_excl(bio_data->bdev);
++#else
++ if (LUReadonly(volume)) {
++ close_bdev_exclusive(bio_data->bdev, FMODE_READ);
++ } else {
++ close_bdev_exclusive(bio_data->bdev, FMODE_READ|FMODE_WRITE);
++ }
++#endif
++ }
+ kfree(bio_data->path);
+
+ kfree(volume->private);
+Index: kernel/conn.c
+===================================================================
+--- kernel/conn.c (revision 198)
++++ kernel/conn.c (working copy)
+@@ -46,9 +46,13 @@
+ "%u.%u.%u.%u", NIPQUAD(inet_sk(sk)->daddr));
+ break;
+ case AF_INET6:
++#ifdef NIP6
+ snprintf(buf, sizeof(buf),
+ "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]",
+ NIP6(inet6_sk(sk)->daddr));
++#else
++ snprintf(buf, sizeof(buf), "[%p6]", &inet6_sk(sk)->daddr);
++#endif
+ break;
+ default:
+ break;
diff --git a/network/iscsitarget/iscsitarget-0.4.17-add_OPTS_cflags.patch b/network/iscsitarget/iscsitarget-0.4.17-add_OPTS_cflags.patch
new file mode 100644
index 0000000000..06e38544d6
--- /dev/null
+++ b/network/iscsitarget/iscsitarget-0.4.17-add_OPTS_cflags.patch
@@ -0,0 +1,9 @@
+diff -Nur iscsitarget-0.4.17.orig/usr/Makefile iscsitarget-0.4.17/usr/Makefile
+--- iscsitarget-0.4.17.orig/usr/Makefile 2008-06-18 18:10:19.000000000 -0500
++++ iscsitarget-0.4.17/usr/Makefile 2009-10-10 22:09:54.221991340 -0500
+@@ -1,4 +1,4 @@
+-CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include
++CFLAGS += $(OPTS) -fno-inline -Wall -Wstrict-prototypes -g -I../include
+ CFLAGS += -D_GNU_SOURCE # required for glibc >= 2.8
+ PROGRAMS = ietd ietadm
+ LIBS = -lcrypto
diff --git a/network/iscsitarget/iscsitarget.SlackBuild b/network/iscsitarget/iscsitarget.SlackBuild
index d055a6c644..04c0b820a3 100644
--- a/network/iscsitarget/iscsitarget.SlackBuild
+++ b/network/iscsitarget/iscsitarget.SlackBuild
@@ -1,8 +1,30 @@
#!/bin/sh
-# Slackware build script for iscsitarget 0.4.16
-
-# Written by Thales A. Tsailas <ttsailas@enforcingit.com>
+# Slackware SlackBuild script
+# ===========================
+# By: Thales A. Tsailas <ttsailas@enforcingit.com>
+# For: iSCSI target
+# Descr: Provides an open source professional iSCSI target solution for Linux
+# URL: http://iscsitarget.sourceforge.net/
+#
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''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 AUTHOR 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.
PRGNAM=iscsitarget
VERSION=0.4.17
@@ -10,7 +32,7 @@ ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-kernel=${kernel:-$(uname -r)}
+KERNEL=${KERNEL:-$(uname -r)}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
@@ -19,10 +41,13 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ SRCARCH=x86 # Needed for the kernel module building
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ SRCARCH=x86 # Needed for the kernel module building
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+ SRCARCH=x86 # Needed for the kernel module building
fi
set -e
@@ -36,14 +61,22 @@ cd $TMP/$PRGNAM-$VERSION
chown -R root:root .
chmod -R a-s,u+w,go+r-w .
+# Patch the source to fix compiling issue with 2.6.29 kernels
+patch -p0 < $CWD/iscsitarget-0.4.17-2.6.29.patch
+
+# Allow use of our SLKCFLAGS for the non-kernel parts
+patch -p1 < $CWD/iscsitarget-0.4.17-add_OPTS_cflags.patch
+
make \
+ OPTS="$SLKCFLAGS" \
MANDIR=/usr/man \
DOCDIR=/usr/doc/$PRGNAM-$VERSION \
- KSRC=/lib/modules/$kernel/build
+ KSRC=/lib/modules/$KERNEL/build \
+ SRCARCH=$SRCARCH
make install \
MANDIR=/usr/man \
DOCDIR=/usr/doc/$PRGNAM-$VERSION \
- KSRC=/lib/modules/$kernel/build \
+ KSRC=/lib/modules/$KERNEL/build \
DISTDIR=$PKG
# Rename init script and don't clobber existing config files on upgrade
@@ -56,22 +89,23 @@ mv $PKG/etc/ietd.conf $PKG/etc/ietd.conf.new
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
# Remove some cruft that shouldn't be in the package
-# (if I'm wrong, let me know) --rworkman
-rm -f $PKG/lib/modules/$kernel/modules*
+rm -f $PKG/lib/modules/$KERNEL/modules*
( cd $PKG
- find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
- find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null || true
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
)
( cd $PKG/usr/man || exit 1
find . -type f -exec gzip -9 {} \;
- for i in `find . -type l` ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+ for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
)
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-cat $CWD/doinst.sh > $PKG/install/doinst.sh
+sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/network/iscsitarget/iscsitarget.info b/network/iscsitarget/iscsitarget.info
index 4f20485b4d..e4fc070e4e 100644
--- a/network/iscsitarget/iscsitarget.info
+++ b/network/iscsitarget/iscsitarget.info
@@ -3,6 +3,8 @@ VERSION="0.4.17"
HOMEPAGE="http://iscsitarget.sourceforge.net/"
DOWNLOAD="http://downloads.sourceforge.net/iscsitarget/iscsitarget-0.4.17.tar.gz"
MD5SUM="e79b437695fc50e7d054631855a16b1b"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
MAINTAINER="Thales A. Tsailas"
EMAIL="ttsailas@enforcingit.com"
APPROVED="rworkman"
diff --git a/network/iscsitarget/rc.iscsi-target b/network/iscsitarget/rc.iscsi-target
new file mode 100644
index 0000000000..6fac6c7575
--- /dev/null
+++ b/network/iscsitarget/rc.iscsi-target
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+# Init script for the iSCSI Enterprise Target.
+# http://iscsitarget.sourceforge.net/
+
+# Written by Thales A. Tsailas For Slackware Linux
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+CONF=/etc/ietd.conf
+PID=$(pidof ietd)
+
+RETVAL=0
+
+start()
+{
+ # Load necessary modules
+ if [ ! "$PID" = '' ]; then
+ echo -en "iSCSI enterprise target is already running\n"
+ else
+ echo -en "Loading iSCSI enterprise target modules\n"
+ modprobe -q crc32c
+ modprobe iscsi_trgt
+ echo -en "Starting iSCSI enterprise target..."
+ /usr/sbin/ietd -c $CONF
+ sleep 1
+
+ if [ $RETVAL = "0" ]; then
+ echo -en "done.\n"
+ else
+ echo -en "failed.\n"
+ exit $RETVAL
+ fi
+ fi
+
+}
+
+stop()
+{
+ if [ "$PID" = '' ]; then
+ echo -en "iSCSI enterprise target is not running\n"
+ else
+ echo -en "Stoping iSCSI enterprise target...\n"
+ ietadm --op delete
+ kill -9 $PID
+ echo -en "Unloading iSCSI enterprise target modules"
+ modprobe -r iscsi_trgt
+ sleep 1
+ if [ $RETVAL = "0" ]; then
+ echo -en "done.\n"
+ else
+ echo -en "failed.\n"
+ exit $RETVAL
+ fi
+ fi
+
+
+}
+
+status()
+{
+ if [ "$PID" = '' ]; then
+ echo -en "iSCSI enterprise target is not running\n"
+ else
+ echo -en "iSCSI enterprise target is running with pid: \033[1m$PID\e[0m\n"
+ echo -en "Available targets:\n"
+ cat /proc/net/iet/session
+ fi
+
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ status)
+ status
+ ;;
+ *)
+ echo "Usage: {start|stop|restart|status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/network/iscsitarget/slack-desc b/network/iscsitarget/slack-desc
index 9c6548ee6d..165eae416f 100644
--- a/network/iscsitarget/slack-desc
+++ b/network/iscsitarget/slack-desc
@@ -15,5 +15,3 @@ iscsitarget:
iscsitarget: http://iscsitarget.sourceforge.net/
iscsitarget:
iscsitarget:
-iscsitarget:
-iscsitarget: