network/iscsitarget: Updated for version 1.4.19.
This commit is contained in:
parent
b8cef6490b
commit
0a1ef8e7c8
|
@ -20,10 +20,17 @@ else
|
||||||
# Install executable otherwise - irrelevant unless user starts in rc.local
|
# Install executable otherwise - irrelevant unless user starts in rc.local
|
||||||
chmod 0755 etc/rc.d/rc.iscsi-target.new
|
chmod 0755 etc/rc.d/rc.iscsi-target.new
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/ietd.conf ];then
|
||||||
|
echo -en "\n\n\n!! iSCSI-target has recently changed the default location for conf files !!\n"
|
||||||
|
echo -en "The new location for conf files is now at /etc/iet\n"
|
||||||
|
echo -en "Furthermore the conf file initiators.deny is obsolete. \nFor futher info read the Man page\n\n\n"
|
||||||
|
fi
|
||||||
|
|
||||||
config etc/rc.d/rc.iscsi-target.new
|
config etc/rc.d/rc.iscsi-target.new
|
||||||
config etc/initiators.deny.new
|
config etc/iet/ietd.conf.new
|
||||||
config etc/initiators.allow.new
|
config etc/iet/targets.allow.new
|
||||||
config etc/ietd.conf.new
|
config etc/iet/initiators.allow.new
|
||||||
|
|
||||||
chroot . depmod -a @KERNEL@ 2>/dev/null 1>/dev/null
|
chroot . depmod -a @KERNEL@ 2>/dev/null 1>/dev/null
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
--- iscsitarget-1.4.19-source/usr/Makefile 2008-06-19 00:10:19.000000000 +0100
|
||||||
|
+++ iscsitarget-1.4.19/usr/Makefile 2010-01-09 17:32:28.000000000 +0000
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include
|
||||||
|
+CFLAGS += @ARCH@ -fno-inline -Wall -Wstrict-prototypes -g -I../include
|
||||||
|
CFLAGS += -D_GNU_SOURCE # required for glibc >= 2.8
|
||||||
|
PROGRAMS = ietd ietadm
|
||||||
|
LIBS = -lcrypto
|
|
@ -1,79 +0,0 @@
|
||||||
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;
|
|
|
@ -1,9 +0,0 @@
|
||||||
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
|
|
|
@ -4,7 +4,7 @@
|
||||||
# ===========================
|
# ===========================
|
||||||
# By: Thales A. Tsailas <ttsailas@enforcingit.com>
|
# By: Thales A. Tsailas <ttsailas@enforcingit.com>
|
||||||
# For: iSCSI target
|
# For: iSCSI target
|
||||||
# Descr: Provides an open source professional iSCSI target solution for Linux
|
# Descr: Provides an iSCSI target solution for Linux
|
||||||
# URL: http://iscsitarget.sourceforge.net/
|
# URL: http://iscsitarget.sourceforge.net/
|
||||||
#
|
#
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
PRGNAM=iscsitarget
|
PRGNAM=iscsitarget
|
||||||
VERSION=0.4.17
|
VERSION=1.4.19
|
||||||
ARCH=${ARCH:-i486}
|
ARCH=${ARCH:-i486}
|
||||||
BUILD=${BUILD:-1}
|
BUILD=${BUILD:-1}
|
||||||
TAG=${TAG:-_SBo}
|
TAG=${TAG:-_SBo}
|
||||||
|
@ -41,13 +41,13 @@ OUTPUT=${OUTPUT:-/tmp}
|
||||||
|
|
||||||
if [ "$ARCH" = "i486" ]; then
|
if [ "$ARCH" = "i486" ]; then
|
||||||
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||||
SRCARCH=x86 # Needed for the kernel module building
|
LIBDIRSUFFIX=""
|
||||||
elif [ "$ARCH" = "i686" ]; then
|
elif [ "$ARCH" = "i686" ]; then
|
||||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||||
SRCARCH=x86 # Needed for the kernel module building
|
LIBDIRSUFFIX=""
|
||||||
elif [ "$ARCH" = "x86_64" ]; then
|
elif [ "$ARCH" = "x86_64" ]; then
|
||||||
SLKCFLAGS="-O2 -fPIC"
|
SLKCFLAGS="-O2 -fPIC"
|
||||||
SRCARCH=x86 # Needed for the kernel module building
|
LIBDIRSUFFIX="64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
@ -61,29 +61,25 @@ cd $TMP/$PRGNAM-$VERSION
|
||||||
chown -R root:root .
|
chown -R root:root .
|
||||||
chmod -R a-s,u+w,go+r-w .
|
chmod -R a-s,u+w,go+r-w .
|
||||||
|
|
||||||
# Patch the source to fix compiling issue with 2.6.29 kernels
|
# Set right ARCH on SLKCFLAGS patch
|
||||||
patch -p0 < $CWD/iscsitarget-0.4.17-2.6.29.patch
|
|
||||||
|
|
||||||
# Allow use of our SLKCFLAGS for the non-kernel parts
|
# Allow use of our SLKCFLAGS for the non-kernel parts
|
||||||
patch -p1 < $CWD/iscsitarget-0.4.17-add_OPTS_cflags.patch
|
sed "s/@ARCH@/$SLKCFLAGS/" $CWD/iscsi-target-1.4.19-add-CFLAGS.patch | patch -p1 || exit 1
|
||||||
|
|
||||||
make \
|
make \
|
||||||
OPTS="$SLKCFLAGS" \
|
|
||||||
MANDIR=/usr/man \
|
MANDIR=/usr/man \
|
||||||
DOCDIR=/usr/doc/$PRGNAM-$VERSION \
|
DOCDIR=/usr/doc/$PRGNAM-$VERSION \
|
||||||
KSRC=/lib/modules/$KERNEL/build \
|
KSRC=/lib/modules/$KERNEL/build
|
||||||
SRCARCH=$SRCARCH
|
|
||||||
make install \
|
make install \
|
||||||
MANDIR=/usr/man \
|
MANDIR=/usr/man \
|
||||||
DOCDIR=/usr/doc/$PRGNAM-$VERSION \
|
DOCDIR=/usr/doc/$PRGNAM-$VERSION \
|
||||||
KSRC=/lib/modules/$KERNEL/build \
|
KSRC=/lib/modules/$KERNEL/build \
|
||||||
DISTDIR=$PKG
|
DISTDIR=$PKG
|
||||||
|
|
||||||
# Rename init script and don't clobber existing config files on upgrade
|
# Scrap original init file and don't clobber existing config files on upgrade
|
||||||
mv $PKG/etc/rc.d/iscsi-target $PKG/etc/rc.d/rc.iscsi-target.new
|
cat $CWD/rc.iscsi-target.new > $PKG/etc/rc.d/rc.iscsi-target.new
|
||||||
mv $PKG/etc/initiators.deny $PKG/etc/initiators.deny.new
|
mv $PKG/etc/iet/ietd.conf $PKG/etc/iet/ietd.conf.new
|
||||||
mv $PKG/etc/initiators.allow $PKG/etc/initiators.allow.new
|
mv $PKG/etc/iet/initiators.allow $PKG/etc/iet/initiators.allow.new
|
||||||
mv $PKG/etc/ietd.conf $PKG/etc/ietd.conf.new
|
mv $PKG/etc/iet/targets.allow $PKG/etc/iet/targets.allow.new
|
||||||
|
|
||||||
# Add the build script to the docs
|
# Add the build script to the docs
|
||||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||||
|
@ -91,12 +87,8 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||||
# Remove some cruft that shouldn't be in the package
|
# Remove some cruft that shouldn't be in the package
|
||||||
rm -f $PKG/lib/modules/$KERNEL/modules*
|
rm -f $PKG/lib/modules/$KERNEL/modules*
|
||||||
|
|
||||||
( cd $PKG
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
||||||
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||||
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
|
( cd $PKG/usr/man || exit 1
|
||||||
find . -type f -exec gzip -9 {} \;
|
find . -type f -exec gzip -9 {} \;
|
||||||
|
@ -105,7 +97,7 @@ rm -f $PKG/lib/modules/$KERNEL/modules*
|
||||||
|
|
||||||
mkdir -p $PKG/install
|
mkdir -p $PKG/install
|
||||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||||
sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||||
|
|
||||||
cd $PKG
|
cd $PKG
|
||||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
PRGNAM="iscsitarget"
|
PRGNAM="iscsitarget"
|
||||||
VERSION="0.4.17"
|
VERSION="1.4.19"
|
||||||
HOMEPAGE="http://iscsitarget.sourceforge.net/"
|
HOMEPAGE="http://iscsitarget.sourceforge.net/"
|
||||||
DOWNLOAD="http://downloads.sourceforge.net/iscsitarget/iscsitarget-0.4.17.tar.gz"
|
DOWNLOAD="http://download.sourceforge.net/iscsitarget/iscsitarget-1.4.19.tar.gz"
|
||||||
MD5SUM="e79b437695fc50e7d054631855a16b1b"
|
MD5SUM="9beca214c28949cce1716b49fec57de4"
|
||||||
DOWNLOAD_x86_64=""
|
DOWNLOAD_x86_64=""
|
||||||
MD5SUM_x86_64=""
|
MD5SUM_x86_64=""
|
||||||
MAINTAINER="Thales A. Tsailas"
|
MAINTAINER="Thales A. Tsailas"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Written by Thales A. Tsailas <ttsailas@enforcingit.com>
|
||||||
# Init script for the iSCSI Enterprise Target.
|
# Init script for the iSCSI Enterprise Target.
|
||||||
# http://iscsitarget.sourceforge.net/
|
# http://iscsitarget.sourceforge.net/
|
||||||
|
# For Slackware Linux
|
||||||
# Written by Thales A. Tsailas For Slackware Linux
|
|
||||||
|
|
||||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
CONF=/etc/ietd.conf
|
CONF=/etc/iet/ietd.conf
|
||||||
PID=$(pidof ietd)
|
PID=$(pidof ietd)
|
||||||
|
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
|
@ -17,8 +17,7 @@ start()
|
||||||
if [ ! "$PID" = '' ]; then
|
if [ ! "$PID" = '' ]; then
|
||||||
echo -en "iSCSI enterprise target is already running\n"
|
echo -en "iSCSI enterprise target is already running\n"
|
||||||
else
|
else
|
||||||
echo -en "Loading iSCSI enterprise target modules\n"
|
echo -en "Loading iSCSI enterprise target module\n"
|
||||||
modprobe -q crc32c
|
|
||||||
modprobe iscsi_trgt
|
modprobe iscsi_trgt
|
||||||
echo -en "Starting iSCSI enterprise target..."
|
echo -en "Starting iSCSI enterprise target..."
|
||||||
/usr/sbin/ietd -c $CONF
|
/usr/sbin/ietd -c $CONF
|
Loading…
Reference in New Issue