summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2013-10-11 20:08:09 +0000
committerChristian Ruppert <idl0r@gentoo.org>2013-10-11 20:08:09 +0000
commitaa4543015a376e7b6a54fd32c60f6cdae27afdb3 (patch)
tree817a4194239b9f36fd676ca12af50a0ef9127dd5 /sys-block/open-iscsi/files
parentMask nx11-misc/lightdm-1.8 for futher testing (diff)
downloadgentoo-2-aa4543015a376e7b6a54fd32c60f6cdae27afdb3.tar.gz
gentoo-2-aa4543015a376e7b6a54fd32c60f6cdae27afdb3.tar.bz2
gentoo-2-aa4543015a376e7b6a54fd32c60f6cdae27afdb3.zip
Version bump, fixes bug 449830, bug 480158 and bug 456906
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key B427ABC8)
Diffstat (limited to 'sys-block/open-iscsi/files')
-rw-r--r--sys-block/open-iscsi/files/iscsid-conf.d18
-rw-r--r--sys-block/open-iscsi/files/iscsid-init.d107
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.873-Makefiles.patch161
3 files changed, 286 insertions, 0 deletions
diff --git a/sys-block/open-iscsi/files/iscsid-conf.d b/sys-block/open-iscsi/files/iscsid-conf.d
new file mode 100644
index 000000000000..02e584fbce52
--- /dev/null
+++ b/sys-block/open-iscsi/files/iscsid-conf.d
@@ -0,0 +1,18 @@
+# /etc/conf.d/iscsid
+
+# config file to use
+CONFIG_FILE=/etc/iscsi/iscsid.conf
+
+# you need to specify an initiatorname in the file
+INITIATORNAME_FILE=/etc/iscsi/initiatorname.iscsi
+
+# options to pass to iscsid
+OPTS="-i ${INITIATORNAME_FILE}"
+
+# Start automatic targets when iscsid is started
+AUTOSTARTTARGETS="yes"
+
+# if set to "strict", iscsid will stop, if connecting the
+# autostart targets failed
+# AUTOSTART="strict"
+
diff --git a/sys-block/open-iscsi/files/iscsid-init.d b/sys-block/open-iscsi/files/iscsid-init.d
new file mode 100644
index 000000000000..0a57f47677da
--- /dev/null
+++ b/sys-block/open-iscsi/files/iscsid-init.d
@@ -0,0 +1,107 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-init.d,v 1.7 2013/10/11 20:08:09 idl0r Exp $
+
+command="/usr/sbin/iscsid"
+command_args="${OPTS}"
+start_stop_daemon_args="-w 10" # iscsid might fail e.g. when the iSCSI kernel modules aren't available
+pidfile=${PIDFILE:-/var/run/${SVCNAME}.pid}
+
+extra_started_commands="starttargets stoptargets"
+extra_commands="restarttargets"
+
+ISCSIADM=/usr/sbin/iscsiadm
+
+depend() {
+ after modules
+ use net
+}
+
+checkconfig() {
+ if [ ! -e /etc/conf.d/${SVCNAME} ]; then
+ eerror "Config file /etc/conf.d/${SVCNAME} does not exist!"
+ return 1
+ fi
+ if [ ! -e "${CONFIG_FILE}" ]; then
+ eerror "Config file ${CONFIG_FILE} does not exist!"
+ return 1
+ fi
+
+ if [ -e ${INITIATORNAME_FILE} ]; then
+ . ${INITIATORNAME_FILE}
+ fi
+ if [ ! -e ${INITIATORNAME_FILE} -o -z "${InitiatorName}" ]; then
+ ewarn "${INITIATORNAME_FILE} should contain a string with your initiatior name."
+ local IQN=$(/usr/sbin/iscsi-iname)
+ ebegin "Creating InitiatorName ${IQN} in ${INITIATORNAME_FILE}"
+ echo "InitiatorName=${IQN}" >> "${INITIATORNAME_FILE}"
+ eend $?
+ fi
+}
+
+starttargets() {
+ ebegin "Setting up iSCSI targets"
+ $ISCSIADM -m node --loginall=automatic
+ local ret=$?
+ eend $ret
+ return $ret
+}
+
+stoptargets() {
+ ebegin "Disconnecting iSCSI targets"
+ sync
+ $ISCSIADM -m node --logoutall=all
+ local ret=$?
+
+ if [ $ret -eq 21 ]; then
+ # See man iscsiadm(8)
+ einfo "No active sessions to disconnect"
+ eend 0
+ return 0
+ fi
+
+ eend $ret
+ return $ret
+}
+
+restarttargets() {
+ stoptargets
+ starttargets
+}
+
+status() {
+ ebegin "Showing current active iSCSI sessions"
+ $ISCSIADM -m session
+}
+
+
+start_pre() {
+ local ret=1
+
+ ebegin "Checking Open-iSCSI configuration"
+ checkconfig
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eend 1
+ return 1
+ fi
+ eend 0
+}
+
+start_post() {
+ # Start automatic targets when iscsid is started
+ if [ "${AUTOSTARTTARGETS}" = "yes" ]; then
+ starttargets
+ local ret=$?
+ if [ "${AUTOSTART}" = "strict" -a $ret -ne 0 ]; then
+ stop
+ return $ret
+ fi
+ fi
+ return 0
+}
+
+stop_pre() {
+ stoptargets
+}
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.873-Makefiles.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.873-Makefiles.patch
new file mode 100644
index 000000000000..db5d6d14ec5a
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.873-Makefiles.patch
@@ -0,0 +1,161 @@
+diff --git a/Makefile b/Makefile
+index c5d9700..4dbff18 100644
+--- a/Makefile
++++ b/Makefile
+@@ -14,8 +14,8 @@ mandir = $(prefix)/share/man
+ etcdir = /etc
+ initddir = $(etcdir)/init.d
+
+-MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8
+-PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname
++MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 doc/iscsistart.8 doc/iscsi-iname.8
++PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname usr/iscsistart
+ INSTALL = install
+ ETCFILES = etc/iscsid.conf
+ IFACEFILES = etc/iface.example
+@@ -84,11 +84,11 @@ install_programs: $(PROGRAMS)
+ # ugh, auto-detection is evil
+ # Gentoo maintains their own init.d stuff
+ install_initd:
+- if [ -f /etc/debian_version ]; then \
++ if [ -f $(DESTDIR)$(etcdir)/debian_version ]; then \
+ $(MAKE) install_initd_debian ; \
+- elif [ -f /etc/redhat-release ]; then \
++ elif [ -f $(DESTDIR)$(etcdir)/redhat-release ]; then \
+ $(MAKE) install_initd_redhat ; \
+- elif [ -f /etc/SuSE-release ]; then \
++ elif [ -f $(DESTDIR)$(etcdir)/SuSE-release ]; then \
+ $(MAKE) install_initd_suse ; \
+ fi
+
+@@ -115,7 +115,7 @@ install_iface: $(IFACEFILES)
+ $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi/ifaces
+
+ install_etc: $(ETCFILES)
+- if [ ! -f /etc/iscsi/iscsid.conf ]; then \
++ if [ ! -f $(DESTDIR)$(etcdir)/iscsi/iscsid.conf ]; then \
+ $(INSTALL) -d $(DESTDIR)$(etcdir)/iscsi ; \
+ $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi ; \
+ fi
+@@ -128,11 +128,11 @@ install_kernel:
+ $(MAKE) -C kernel install_kernel
+
+ install_iname:
+- if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then \
+- echo "InitiatorName=`$(DESTDIR)/sbin/iscsi-iname`" > $(DESTDIR)/etc/iscsi/initiatorname.iscsi ; \
++ if [ ! -f $(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi ]; then \
++ echo "InitiatorName=`$(DESTDIR)$(sbindir)/iscsi-iname`" > $(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi ; \
+ echo "***************************************************" ; \
+- echo "Setting InitiatorName to `cat $(DESTDIR)/etc/iscsi/initiatorname.iscsi`" ; \
+- echo "To override edit /etc/iscsi/initiatorname.iscsi" ; \
++ echo "Setting InitiatorName to `cat $(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi`" ; \
++ echo "To override edit $(etcdir)/iscsi/initiatorname.iscsi" ; \
+ echo "***************************************************" ; \
+ fi
+
+diff --git a/usr/Makefile b/usr/Makefile
+index 673b7f1..83507f3 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -54,18 +54,18 @@ all: $(PROGRAMS)
+
+ iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
+ iscsid.o session_mgmt.o discoveryd.o
+- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns
+
+ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
+- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns
+
+ iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
+ iscsistart.o statics.o
+- $(CC) $(CFLAGS) -static $^ -o $@
++ $(CC) $(CFLAGS) -static $(LDFLAGS) $^ -o $@
+ clean:
+- rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
++ $(RM) *.o $(PROGRAMS) .depend $(LIBSYS)
+
+ depend:
+- gcc $(CFLAGS) -M `ls *.c` > .depend
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
+
+ -include .depend
+diff --git a/utils/Makefile b/utils/Makefile
+index 2c7e891..62c49fa 100644
+--- a/utils/Makefile
++++ b/utils/Makefile
+@@ -1,17 +1,18 @@
+ # This Makefile will work only with GNU make.
+
+-CFLAGS += $(OPTFLAGS) -O2 -fno-inline -Wall -Wstrict-prototypes -g
++OPTFLAGS ?= -O2 -g
++CFLAGS += $(OPTFLAGS) -fno-inline -Wall -Wstrict-prototypes
+ PROGRAMS = iscsi-iname
+
+ all: $(PROGRAMS)
+
+ iscsi-iname: md5.o iscsi-iname.o
+- $(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(DBM_LIB) -o $@
+
+ clean:
+- rm -f *.o $(PROGRAMS) .depend
++ $(RM) *.o $(PROGRAMS) .depend
+
+ depend:
+- gcc $(CFLAGS) -M `ls *.c` > .depend
++ $(GCC) $(CFLAGS) -M `ls *.c` > .depend
+
+ -include .depend
+diff --git a/utils/fwparam_ibft/Makefile b/utils/fwparam_ibft/Makefile
+index c72bb7f..a36c2d2 100644
+--- a/utils/fwparam_ibft/Makefile
++++ b/utils/fwparam_ibft/Makefile
+@@ -26,18 +26,18 @@ OBJS := fw_entry.o fwparam_sysfs.o $(SYSDEPS_OBJS) ../../usr/iscsi_net_util.o
+ OBJS += prom_lex.o prom_parse.tab.o fwparam_ppc.o
+ CLEANFILES = $(OBJS) *.output *~
+
+-OPTFLAGS ?= -O2 -g -fPIC
++OPTFLAGS ?= -O2 -g
+ WARNFLAGS ?= -Wall -Wstrict-prototypes
+-CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../../include -I../../usr -D_GNU_SOURCE
++CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -fPIC -I../../include -I../../usr -D_GNU_SOURCE
+
+ all: $(OBJS)
+
+ clean:
+- rm -f *.o $(CLEANFILES) .depend
++ $(RM) *.o $(CLEANFILES) .depend
+
+ $(OBJS): prom_parse.tab.h prom_parse.h fwparam_ibft.h
+
+ depend:
+- gcc $(CFLAGS) -M `ls *.c` > .depend
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
+
+ -include .depend
+diff --git a/utils/sysdeps/Makefile b/utils/sysdeps/Makefile
+index 53c10e5..19cfe19 100644
+--- a/utils/sysdeps/Makefile
++++ b/utils/sysdeps/Makefile
+@@ -1,15 +1,16 @@
+ # This Makefile will work only with GNU make.
+
+-CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -O2 -fno-inline -Wall -Wstrict-prototypes -g
++OPTFLAGS ?= -O2 -g
++CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -fno-inline -Wall -Wstrict-prototypes
+
+ SYSDEPS_OBJS=sysdeps.o
+
+ all: $(SYSDEPS_OBJS)
+
+ clean:
+- rm -f *.o .depend
++ $(RM) *.o .depend
+
+ depend:
+- gcc $(CFLAGS) -M `ls *.c` > .depend
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
+
+ -include .depend