+++ /dev/null
-# /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"
-
+++ /dev/null
---- open-iscsi-2.0-872.orig/Makefile
-+++ open-iscsi-2.0-872/Makefile
-@@ -27,7 +27,7 @@ IFACEFILES = etc/iface.example
- all: user kernel
-
- user: ;
-- cd utils/open-isns; ./configure; $(MAKE)
-+ cd utils/open-isns; $(MAKE)
- $(MAKE) -C utils/sysdeps
- $(MAKE) -C utils/fwparam_ibft
- $(MAKE) -C usr
+++ /dev/null
---- usr/iscsid.c 2010-10-10 23:06:37.000000000 +0200
-+++ usr/iscsid.c 2010-10-10 23:07:55.000000000 +0200
-@@ -31,6 +31,7 @@
- #include <sys/utsname.h>
- #include <sys/types.h>
- #include <sys/wait.h>
-+#include <sys/stat.h>
-
- #include "iscsid.h"
- #include "mgmt_ipc.h"
+++ /dev/null
-#!/sbin/openrc-run
-# Copyright 1999-2013 Gentoo Foundation, Inc.
-# Distributed under the terms of the GNU General Public License, v2 or later
-
-opts="${opts} starttargets stoptargets restarttargets"
-
-depend() {
- after modules
- use net
-}
-
-PIDFILE=${PIDFILE:-/var/run/${SVCNAME}.pid}
-BINARY="/usr/sbin/iscsid"
-
-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} ] || [ ! "$(grep "^InitiatorName=iqn\." ${INITIATORNAME_FILE})" ]; then
- ewarn "${INITIATORNAME_FILE} should contain a string with your initiatior name."
- IQN=iqn.$(date +%Y-%m).$(hostname -f | awk 'BEGIN { FS=".";}{x=NF; while (x>0) {printf $x ;x--; if (x>0) printf ".";} print ""}'):openiscsi
- IQN=${IQN}-$(echo ${RANDOM}${RANDOM}${RANDOM}${RANDOM}${RANDOM} | md5sum | sed -e "s/\(.*\) -/\1/g" -e 's/ //g')
- ebegin "Creating InitiatorName ${IQN} in ${INITIATORNAME_FILE}"
- echo "InitiatorName=${IQN}" >> "${INITIATORNAME_FILE}"
- eend $?
- fi
-}
-
-do_modules() {
- msg="$1"
- shift
- modules="${1}"
- shift
- modopts="$@"
- for m in ${modules}
- do
- if modprobe --show --quiet "${m}"
- then
- ebegin "${msg} ${m}"
- modprobe ${modopts} ${m}
- ret=$?
- eend ${ret}
- if [ ${ret} -ne 0 ]; then
- return ${ret}
- fi
- else
- ebegin "${msg} ${m}: not found"
- return 1
- fi
- done
- return 0
-}
-
-start() {
- ebegin "Checking open-iSCSI configuration"
- checkconfig
- ret=$?
- if [ $ret -ne 0 ]; then
- eend 1
- return 1
- fi
- ebegin "Loading iSCSI modules"
- do_modules 'Loading' 'libiscsi scsi_transport_iscsi iscsi_tcp'
- ret=$?
- if [ $ret -ne 0 ]; then
- eend 1
- return 1
- fi
-
- ebegin "Starting ${SVCNAME}"
- start-stop-daemon --start --quiet --exec ${BINARY} -- ${OPTS}
- ret=$?
- if [ $ret -ne 0 ]; then
- eend $?
- return $?
- fi
-
- # Start automatic targets when iscsid is started
- if [ "${AUTOSTARTTARGETS}" = "yes" ]; then
- starttargets
- ret=$?
- if [ "${AUTOSTART}" = "strict" ] && [ $ret -ne 0 ]; then
- stop
- return $ret
- fi
- fi
- return 0
-}
-
-stop() {
- stoptargets
- ebegin "Stopping ${SVCNAME}"
- start-stop-daemon --stop --quiet --exec ${BINARY} --pidfile ${PIDFILE}
- eend $?
-
- do_modules 'Removing iSCSI modules' 'iscsi_tcp scsi_transport_iscsi libiscsi' '-r'
- eend $?
-}
-
-starttargets() {
- ebegin "Setting up iSCSI targets"
- /usr/sbin/iscsiadm -m node --loginall=automatic
- ret=$?
- eend $ret
- return $ret
-}
-
-stoptargets() {
- ebegin "Disconnecting iSCSI targets"
- sync
- /usr/sbin/iscsiadm -m node --logoutall=all
- ret=$?
- eend $ret
- return $ret
-}
-
-restarttargets() {
- stoptargets
- starttargets
-}
-
-status() {
- ebegin "Showing current active iSCSI sessions"
- /usr/sbin/iscsiadm -m session
-}
+++ /dev/null
-diff -Nuar open-iscsi-2.0-872.orig/usr/Makefile open-iscsi-2.0-872/usr/Makefile
---- open-iscsi-2.0-872.orig/usr/Makefile 2012-02-09 08:25:13.656604152 +0000
-+++ open-iscsi-2.0-872/usr/Makefile 2012-02-09 08:26:28.960171260 +0000
-@@ -53,10 +53,10 @@
-
- iscsid: $(ISCSI_LIB_SRCS) $(IPC_OBJ) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
- iscsid.o session_mgmt.o discoveryd.o
-- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
-+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns $(SLP_LIBS) -lcrypto
-
- iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
-- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
-+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns $(SLP_LIBS) -lcrypto
-
- iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
- iscsistart.o statics.o
+++ /dev/null
---- utils/Makefile 2011-05-31 01:30:27.302609540 +0200
-+++ utils/Makefile 2011-05-31 01:32:50.229602790 +0200
-@@ -6,7 +6,7 @@
- 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
+++ /dev/null
-diff -NuarwbB open-iscsi-2.0-872/usr/Makefile open-iscsi-2.0-872.orig/usr/Makefile
---- open-iscsi-2.0-872.orig/usr/Makefile 2012-02-09 08:58:04.402623915 +0000
-+++ open-iscsi-2.0-872/usr/Makefile 2012-02-09 08:56:51.159070006 +0000
-@@ -65,6 +65,6 @@
- rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
-
- depend:
-+ $(CC) $(CFLAGS) -M `ls *.c` > .depend
-- gcc $(CFLAGS) -M `ls *.c` > .depend
-
- -include .depend
-diff -NuarwbB open-iscsi-2.0-872/utils/fwparam_ibft/Makefile open-iscsi-2.0-872.orig/utils/fwparam_ibft/Makefile
---- open-iscsi-2.0-872.orig/utils/fwparam_ibft/Makefile 2012-02-09 08:57:58.579273051 +0000
-+++ open-iscsi-2.0-872/utils/fwparam_ibft/Makefile 2010-08-11 15:27:07.000000000 +0000
-@@ -38,6 +38,6 @@
- $(OBJS): prom_parse.tab.h prom_parse.h fwparam_ibft.h
-
- depend:
-+ $(CC) $(CFLAGS) -M `ls *.c` > .depend
-- gcc $(CFLAGS) -M `ls *.c` > .depend
-
- -include .depend
-diff -NuarwbB open-iscsi-2.0-872/utils/Makefile open-iscsi-2.0-872.orig/utils/Makefile
---- open-iscsi-2.0-872.orig/utils/Makefile 2012-02-09 08:57:37.825877235 +0000
-+++ open-iscsi-2.0-872/utils/Makefile 2012-02-09 08:56:51.145736633 +0000
-@@ -12,6 +12,6 @@
- rm -f *.o $(PROGRAMS) .depend
-
- depend:
-+ $(CC) $(CFLAGS) -M `ls *.c` > .depend
-- gcc $(CFLAGS) -M `ls *.c` > .depend
-
- -include .depend
-diff -NuarwbB open-iscsi-2.0-872/utils/open-isns/Makefile.in open-iscsi-2.0-872.orig/utils/open-isns/Makefile.in
---- open-iscsi-2.0-872.orig/utils/open-isns/Makefile.in 2012-02-09 08:57:47.812573971 +0000
-+++ open-iscsi-2.0-872/utils/open-isns/Makefile.in 2010-08-11 15:27:07.000000000 +0000
-@@ -77,6 +77,6 @@
- ar cr $@ $(LIBOBJS)
-
- depend:
-+ $(CC) $(CFLAGS) -M `ls *.c` > .depend
-- gcc $(CFLAGS) -M `ls *.c` > .depend
-
- -include .depend
-diff -NuarwbB open-iscsi-2.0-872/utils/sysdeps/Makefile open-iscsi-2.0-872.orig/utils/sysdeps/Makefile
---- open-iscsi-2.0-872.orig/utils/sysdeps/Makefile 2012-02-09 08:57:43.459227530 +0000
-+++ open-iscsi-2.0-872/utils/sysdeps/Makefile 2010-08-11 15:27:07.000000000 +0000
-@@ -10,6 +10,6 @@
- rm -f *.o .depend
-
- depend:
-+ $(CC) $(CFLAGS) -M `ls *.c` > .depend
-- gcc $(CFLAGS) -M `ls *.c` > .depend
-
- -include .depend
+++ /dev/null
---- usr/Makefile 2010-10-10 22:48:04.000000000 +0200
-+++ usr/Makefile.ori 2010-10-10 22:48:34.000000000 +0200
-@@ -53,14 +53,14 @@
-
- iscsid: $(ISCSI_LIB_SRCS) $(IPC_OBJ) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
- iscsid.o session_mgmt.o discoveryd.o
-- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
-+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
-
- iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
-- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
-+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
-
- iscsistart: $(IPC_OBJ) $(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)
-