[Lunar-commits] <moonbase> open-iscsi: Initial import
Stefan Wold
ratler at lunar-linux.org
Tue May 17 23:04:51 CEST 2011
commit 78aaa31a8dad6862562602bc4abd6012ae0c1001
Author: Stefan Wold <ratler at lunar-linux.org>
Date: Tue May 17 23:04:51 2011 +0200
open-iscsi: Initial import
---
zbeta/open-iscsi/BUILD | 19 +++++++
zbeta/open-iscsi/DEPENDS | 1 +
zbeta/open-iscsi/DETAILS | 26 +++++++++
zbeta/open-iscsi/config.d/open-iscsi | 8 +++
zbeta/open-iscsi/init.d/open-iscsi | 93 ++++++++++++++++++++++++++++++++++
5 files changed, 147 insertions(+), 0 deletions(-)
diff --git a/zbeta/open-iscsi/BUILD b/zbeta/open-iscsi/BUILD
new file mode 100644
index 0000000..4257434
--- /dev/null
+++ b/zbeta/open-iscsi/BUILD
@@ -0,0 +1,19 @@
+(
+
+ patch_it $SOURCE2 0 &&
+ patch_it $SOURCE3 0 &&
+ patch_it $SOURCE4 1 &&
+ patch_it $SOURCE5 1 &&
+
+ sedit 's;-lisns;& -lslp;g' usr/Makefile &&
+
+ cd $SOURCE_DIRECTORY/utils/open-isns &&
+ ./configure --with-slp &&
+ cd $SOURCE_DIRECTORY &&
+ OPTFLAGS=$CFLAGS make user &&
+ prepare_install &&
+ make sbindir=/sbin install_user &&
+ install -m 0755 -o root -g root usr/iscsistart /sbin/ &&
+ chmod 600 /etc/iscsi/iscsid.conf
+
+) > $C_FIFO 2>&1
diff --git a/zbeta/open-iscsi/DEPENDS b/zbeta/open-iscsi/DEPENDS
new file mode 100644
index 0000000..f43569e
--- /dev/null
+++ b/zbeta/open-iscsi/DEPENDS
@@ -0,0 +1 @@
+depends openslp
diff --git a/zbeta/open-iscsi/DETAILS b/zbeta/open-iscsi/DETAILS
new file mode 100644
index 0000000..52317f4
--- /dev/null
+++ b/zbeta/open-iscsi/DETAILS
@@ -0,0 +1,26 @@
+ MODULE=open-iscsi
+ VERSION=2.0-872
+ SOURCE=${MODULE}-${VERSION}.tar.bz2
+ SOURCE2=open-iscsi-2.0.872-makefile-cleanup.patch
+ SOURCE3=open-iscsi-2.0.872-glibc212.patch
+ SOURCE4=open-iscsi-2.0.872-slp.patch
+ SOURCE5=open-iscsi-2.0.872-omg-calling-configure.patch
+ SOURCE_URL=ftp://ftp.se.kernel.org/pub/linux/kernel/people/mnc/open-iscsi/releases/
+ SOURCE2_URL=$PATCH_URL
+ SOURCE3_URL=$PATCH_URL
+ SOURCE4_URL=$PATCH_URL
+ SOURCE5_URL=$PATCH_URL
+SOURCE_DIRECTORY=$BUILD_DIRECTORY/$MODULE-$VERSION
+ SOURCE_VFY=sha256:1680061046335a2cd8e136872ec564728361acbfff1477a5179fc984a8933804
+ SOURCE2_VFY=sha256:c0e92ba2211dd74e89dcc0c5793e02ad8ad06b41a07a0687007bba6415546dfd
+ SOURCE3_VFY=sha256:e7b299da12daed432f18a115b7a14eadb61a3db13df89af21a9078357ebf63ca
+ SOURCE4_VFY=sha256:c53c6da442bbaf2e0e67d18029d1f6292a21a332b971acbfb01bccbdb9873ef8
+ SOURCE5_VFY=sha256:92ab247afde924a6d07643abc2cb34598a2fb13f62718684803ab44b9bce7241
+ WEB_SITE="http://www.open-iscsi.org/"
+ ENTERED=20110517
+ UPDATED=20110517
+ SHORT="A high performance, transport independent, multi-platform implementation of RFC3720"
+cat <<EOF
+Open-iSCSI is a high performance, transport independent, multi-platform
+implementation of RFC3720
+EOF
diff --git a/zbeta/open-iscsi/config.d/open-iscsi b/zbeta/open-iscsi/config.d/open-iscsi
new file mode 100644
index 0000000..893fc65
--- /dev/null
+++ b/zbeta/open-iscsi/config.d/open-iscsi
@@ -0,0 +1,8 @@
+
+CONFIG_FILE=/etc/iscsi/iscsid.conf
+
+INITIATORNAME_FILE=/etc/iscsi/initiatorname.iscsi
+
+ARGS="-c $CONFIG_FILE -i $INITIATORNAME_FILE"
+
+STARTTARGETS=yes
diff --git a/zbeta/open-iscsi/init.d/open-iscsi b/zbeta/open-iscsi/init.d/open-iscsi
new file mode 100755
index 0000000..f757511
--- /dev/null
+++ b/zbeta/open-iscsi/init.d/open-iscsi
@@ -0,0 +1,93 @@
+#!/bin/bash
+#
+# Startup script for open iscsi
+#
+# chkconfig: 345 20 85
+# description: Open-iscsi is a high performance, transport independent, multi-platform implementation of RFC3720
+# processname: iscsid
+
+
+# Config settings
+[ -f /etc/config.d/open-iscsi ] && . /etc/config.d/open-iscsi
+
+if [ ! -e $CONFIG_FILE ]; then
+ echo "Config file not found!"
+ exit 1
+fi
+
+if [ ! -e $INITIATORNAME_FILE ]; then
+ echo "Initiatorname file not found!"
+ exit 1
+fi
+
+modules()
+{
+
+ for i in $1; do
+ modprobe $2 $i || return 1
+ done
+ return 0
+}
+
+start()
+{
+ echo -n "Loading iSCSI modules: "
+ modules "libiscsi scsi_transport_iscsi iscsi_tcp" &&
+ echo -e $RESULT_OK || echo -e $RESULT_FAIL
+
+ echo -n "Starting iscsid: "
+ /sbin/iscsid $ARGS &&
+ echo -e $RESULT_OK || echo -e $RESULT_FAIL
+
+ [ "$STARTTARGETS" = "yes" ] && starttargets
+}
+
+starttargets()
+{
+ echo "Connecting iSCSI targets"
+ /sbin/iscsiadm -m node -L automatic
+}
+
+stop()
+{
+ stoptargets
+ echo -n "Stopping iscsid: "
+ kill $(cat /var/run/iscsid.pid) &&
+ echo -e $RESULT_OK || echo -e $RESULT_FAIL
+ echo -n "Unloading iSCSI modules: "
+ modules "iscsi_tcp scsi_transport_iscsi libiscsi" -r &&
+ echo -e $RESULT_OK || $RESULT_FAIL
+
+ rm -f /var/run/iscsid.pid
+}
+
+stoptargets()
+{
+ echo "Disconnecting iSCSI targets"
+ /sbin/iscsiadm -m node -U all
+}
+
+restart()
+{
+ $0 stop
+ sleep 2
+ $0 start
+}
+
+restarttargets()
+{
+ $0 stoptargets
+ sleep 2
+ $0 starttargets
+
+}
+
+status()
+{
+ echo "Active iSCSI sessions"
+ /sbin/iscsiadm -m session
+}
+
+
+. /lib/lsb/init-functions
+
More information about the Lunar-commits
mailing list