summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2009-11-12 09:29:49 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2009-11-12 09:29:49 +0000
commit89a16188c74531e8662b7f23fde95d4c6e7f0491 (patch)
tree27f9afc4221e9f700864c6fd221dd0657768e395 /sys-block/open-iscsi
parentVersion bump (diff)
downloadhistorical-89a16188c74531e8662b7f23fde95d4c6e7f0491.tar.gz
historical-89a16188c74531e8662b7f23fde95d4c6e7f0491.tar.bz2
historical-89a16188c74531e8662b7f23fde95d4c6e7f0491.zip
Cleanup remaining modules code so that kernel sources are no longer required. Do not decide what to include in the binpkg based on $ROOT, as it may be for use on a different machine. Always install the utils. Bug #273321: Do not build iscsistart statically. Bug #284871: Fix init.d return codes. Bug #291584: install initiatorname.iscsi in the correct place.
Package-Manager: portage-2.2_rc49/cvs/Linux x86_64
Diffstat (limited to 'sys-block/open-iscsi')
-rw-r--r--sys-block/open-iscsi/ChangeLog15
-rw-r--r--sys-block/open-iscsi/Manifest5
-rw-r--r--sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d127
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.871-makefile-cleanup.patch33
-rw-r--r--sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild89
5 files changed, 267 insertions, 2 deletions
diff --git a/sys-block/open-iscsi/ChangeLog b/sys-block/open-iscsi/ChangeLog
index 1a4a9c61bf54..21b58fd2ba2e 100644
--- a/sys-block/open-iscsi/ChangeLog
+++ b/sys-block/open-iscsi/ChangeLog
@@ -1,6 +1,19 @@
# ChangeLog for sys-block/open-iscsi
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/ChangeLog,v 1.23 2009/10/28 16:47:54 dertobi123 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/ChangeLog,v 1.24 2009/11/12 09:29:49 robbat2 Exp $
+
+*open-iscsi-2.0.871-r1 (12 Nov 2009)
+
+ 12 Nov 2009; Robin H. Johnson <robbat2@gentoo.org>
+ +open-iscsi-2.0.871-r1.ebuild,
+ +files/open-iscsi-2.0.871-makefile-cleanup.patch,
+ +files/iscsid-2.0.871-r1.init.d:
+ Cleanup remaining modules code so that kernel sources are no longer
+ required. Do not decide what to include in the binpkg based on $ROOT, as
+ it may be for use on a different machine. Always install the utils. Bug
+ #273321: Do not build iscsistart statically. Bug #284871: Fix init.d
+ return codes. Bug #291584: install initiatorname.iscsi in the correct
+ place.
*open-iscsi-2.0.871 (28 Oct 2009)
diff --git a/sys-block/open-iscsi/Manifest b/sys-block/open-iscsi/Manifest
index 49dc1a171b5e..1b9522da3a75 100644
--- a/sys-block/open-iscsi/Manifest
+++ b/sys-block/open-iscsi/Manifest
@@ -1,10 +1,13 @@
AUX CVE-2009-1297.patch 798 RMD160 e1f3411aef17b8e238928b88ebe008b2ae28c070 SHA1 55f3af418fb3eebe2b2f1ee59dc94b8a6ef0ad9a SHA256 b52320fb0e25876d7b9cd7a40e1a01246a9175822c98c3796d6e2822fda39af5
AUX initiatorname.iscsi 1282 RMD160 6af81c25d2704e2c6bb98ff5155de91cdbd17ff7 SHA1 2d2b0a50652772e0e3a16f3a90ef5977639b97ee SHA256 4ae558522881796f67ad5915ecf38d01e64c9d9768469847adb17405404485f3
+AUX iscsid-2.0.871-r1.init.d 2916 RMD160 8a596eaf43e9c708b92b948d73a7d6385854dd3c SHA1 2c2c514b01199ef94f955fffa58a0be464a1912b SHA256 e0a8c9aa68c0f87f7e9ac89b7299e5a905d33fd271d58f7d6d0bfaea661862c9
AUX iscsid-conf.d 314 RMD160 de4885dcc1ed6440ea385b7b234deeaa9cb18478 SHA1 57b899e74027252f5686c0bf28aafbda6f669132 SHA256 673bf4744efc3276d372587c996270821d39dcdc0bf27a13691ea6b0e814b6d0
AUX iscsid-init.d 2784 RMD160 92f19340add0cf178c451fb143d5871381e70480 SHA1 ce1be0f5e7e0b7f40371b9fb12f283ca713e295b SHA256 8ff8f100a6058d31605de54b1f210d5293c4b7441973e5793f42f67cac4fed30
+AUX open-iscsi-2.0.871-makefile-cleanup.patch 1205 RMD160 04f60526916cd9a707e4c3158c6cb7edc7da4169 SHA1 be59e170705927b1b3dffd07329a1a20d067e8df SHA256 8412850ea40dd7b5bacbae18c760ef305df36dbaa507d9618555e32c8e8e2ae6
DIST open-iscsi-2.0-870.3.tar.gz 301242 RMD160 f3be0aeaa7b2988a794983bc6d88511026605b13 SHA1 bc8253558b1a6b0c12ec0fbb0f01d6cb56d39395 SHA256 8ca6708895b17424efe20a4f6cbdf32ea44c40e7d9faa0f9c44bd720bae715ec
DIST open-iscsi-2.0-871.tar.gz 330514 RMD160 f996d9145bc3727394f1a4999f430bd5ea5c2a0d SHA1 968baf16d4094fb9842bc04b0fe8109103356252 SHA256 bcea8746ae82f2ada7bc05d2aa59bcda1ca0d5197f05f2e16744aae59f0a7dcb
EBUILD open-iscsi-2.0.870.3-r1.ebuild 3058 RMD160 7cca1692b8ee288e2c04e66bdb06935b5d6b70c4 SHA1 263017243b71cbd37001dd546aaa34b46b8a33c7 SHA256 d01d147e91894ce4ec23b5d9d6ebe7aa8a09c983c3e5738b4674837eed976613
+EBUILD open-iscsi-2.0.871-r1.ebuild 2526 RMD160 58ef9f3e9bedaa9e4c88af2912504b2a14112fab SHA1 4f0acb2fc3ef42f0495326df20703f3da057234f SHA256 43ed96a6d1f2a5bb873b7c8859355705da6ac890a3fb6954b42ba9a778394c60
EBUILD open-iscsi-2.0.871.ebuild 3149 RMD160 1999c962be1a5c8ac5da72703ba206faa30bda1e SHA1 d4742fd50339c3e62c06e67edb058dfa5f9bbd33 SHA256 00f70a8e3f1efeb0db97ec5a0e12ef42fe59e6c92ea0a7478107b7f72e75f644
-MISC ChangeLog 5410 RMD160 b4dd76dd03942ad4faeb7e8709a1be07fc9c9a66 SHA1 cc5489fd1cea77b1a5a8eb2669fd2ab67351c15e SHA256 fdd1f794b48458592b0f7a450e68162c8199cd8351639abe554f9799c2b6d32c
+MISC ChangeLog 5990 RMD160 537396f02459edf96d73d956bbc63d0c65f90f00 SHA1 07f24a732dc2e88b6f1c00944062b245fc117d7c SHA256 903ab03869bf22c5d2a4cfe11fed4c875fb8a4e34eb9bf5463755c4a691d391d
MISC metadata.xml 366 RMD160 e6901bcc9954fa2e7ebdc201be3f117f2769d11e SHA1 2f12a23a3bd4a33409183a32a99708dc4ce236e4 SHA256 023a201ecaa94699b402156f02c08c416e6eed0584f2096152605f3bef5df31a
diff --git a/sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d b/sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d
new file mode 100644
index 000000000000..179c131923eb
--- /dev/null
+++ b/sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d
@@ -0,0 +1,127 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Technologies, 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-2.0.871-r1.init.d,v 1.1 2009/11/12 09:29:48 robbat2 Exp $
+
+opts="${opts} starttargets stoptargets restarttargets"
+
+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} ] || [ ! "$(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 [ -n "$(modprobe -l | grep ${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 /usr/sbin/iscsid -- ${OPTS}
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eend $?
+ return $?
+ fi
+
+ # Start automatic targets when iscsid is started
+ if [ "${AUTOSTARTTARGETS}" = "yes" ]; then
+ starttargets
+ return $?
+ fi
+ return 0
+}
+
+stop() {
+ stoptargets
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --signal HUP --stop --quiet --exec /usr/sbin/iscsid #--pidfile $PID_FILE
+ eend $?
+
+ # ugly, but pid file is not removed by iscsid
+ rm -f $PID_FILE
+
+ 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
+}
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.871-makefile-cleanup.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.871-makefile-cleanup.patch
new file mode 100644
index 000000000000..6ca2a4eabab1
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.871-makefile-cleanup.patch
@@ -0,0 +1,33 @@
+diff -Nuar open-iscsi-2.0-871.orig/usr/Makefile open-iscsi-2.0-871/usr/Makefile
+--- open-iscsi-2.0-871.orig/usr/Makefile 2009-07-10 20:55:58.000000000 -0700
++++ open-iscsi-2.0-871/usr/Makefile 2009-11-12 00:58:16.467960344 -0800
+@@ -48,14 +48,14 @@
+ all: $(PROGRAMS)
+
+ iscsid: $(COMMON_SRCS) $(IPC_OBJ) $(INITIATOR_SRCS) iscsid.o
+- $(CC) $(CFLAGS) $^ -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ iscsiadm: $(COMMON_SRCS) $(FW_BOOT_SRCS) strings.o discovery.o iscsiadm.o
+- $(CC) $(CFLAGS) $^ -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
+ iscsistart.o statics.o
+- $(CC) $(CFLAGS) -static $^ -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+ clean:
+ rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
+
+diff -Nuar open-iscsi-2.0-871.orig/utils/Makefile open-iscsi-2.0-871/utils/Makefile
+--- open-iscsi-2.0-871.orig/utils/Makefile 2009-07-10 20:55:58.000000000 -0700
++++ open-iscsi-2.0-871/utils/Makefile 2009-11-12 00:58:56.404623435 -0800
+@@ -6,7 +6,7 @@
+ all: $(PROGRAMS)
+
+ iscsi-iname: md5.o iscsi-iname.o
+- $(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(DBM_LIB) $^
+
+ clean:
+ rm -f *.o $(PROGRAMS) .depend
diff --git a/sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild b/sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild
new file mode 100644
index 000000000000..ebf24f0944d9
--- /dev/null
+++ b/sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild,v 1.1 2009/11/12 09:29:49 robbat2 Exp $
+
+EAPI=2
+inherit versionator linux-info eutils flag-o-matic
+
+DESCRIPTION="Open-iSCSI is a high performance, transport independent, multi-platform implementation of RFC3720"
+HOMEPAGE="http://www.open-iscsi.org/"
+MY_PV="${PN}-$(replace_version_separator 2 "-" $MY_PV)"
+SRC_URI="http://www.open-iscsi.org/bits/${MY_PV}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64 ~ppc ~mips"
+IUSE="debug"
+DEPEND=""
+RDEPEND="${DEPEND}
+ sys-apps/util-linux"
+
+S="${WORKDIR}/${MY_PV}"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ if [ $KV_PATCH -lt 15 ]; then
+ die "Sorry, your kernel must be 2.6.16-rc5 or newer!"
+ fi
+
+ # Needs to be done, as iscsid currently only starts, when having the iSCSI
+ # support loaded as module. Kernel builtion options don't work. See this for
+ # more information:
+ # http://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966
+ # If there's a new release, check whether this is still valid!
+ if linux_config_exists; then
+ for module in ${CONFIG_CHECK_MODULES}; do
+ linux_chkconfig_module ${module} || die "${module} needs to be built as module (builtin doesn't work)"
+ done
+ fi
+}
+
+src_prepare() {
+ export EPATCH_OPTS="-d${S}"
+ epatch "${FILESDIR}"/CVE-2009-1297.patch
+ epatch "${FILESDIR}"/${PN}-2.0.871-makefile-cleanup.patch
+}
+
+src_compile() {
+ use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI
+
+ einfo "Building userspace"
+ cd "${S}" && \
+ CFLAGS="" emake OPTFLAGS="${CFLAGS}" user \
+ || die "emake failed"
+}
+
+src_install() {
+ einfo "Installing userspace"
+ dosbin usr/iscsid usr/iscsiadm usr/iscsistart
+
+ einfo "Installing utilities"
+ dosbin utils/iscsi-iname utils/iscsi_discovery
+
+ einfo "Installing docs"
+ doman doc/*[1-8]
+ dodoc README THANKS
+ docinto test
+ dodoc test/*
+
+ einfo "Installing configuration"
+ insinto /etc/iscsi
+ doins etc/iscsid.conf
+ newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example
+ insinto /etc/iscsi/ifaces
+ doins etc/iface.example
+
+ newconfd "${FILESDIR}"/iscsid-conf.d iscsid
+ newinitd "${FILESDIR}"/iscsid-2.0.871-r1.init.d iscsid
+
+ keepdir /var/db/iscsi
+ fperms 700 /var/db/iscsi
+ fperms 600 /etc/iscsi/iscsid.conf
+}
+
+pkg_postinst() {
+ in='/etc/iscsi/initiatorname.iscsi'
+ if [ ! -f "${ROOT}${in}" -a -f "${ROOT}${in}.example" ]; then
+ cp -f "${ROOT}${in}.example" "${ROOT}${in}"
+ fi
+}