diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2005-09-23 05:55:28 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2005-09-23 05:55:28 +0000 |
commit | d0fb555f06788f21237348022e225bcb247b058f (patch) | |
tree | f12d3bd3a0d1c6ee528032bf6e40967ce9ebe898 /sys-block | |
parent | d'oh, L = 1 on courier-new! (diff) | |
download | gentoo-2-d0fb555f06788f21237348022e225bcb247b058f.tar.gz gentoo-2-d0fb555f06788f21237348022e225bcb247b058f.tar.bz2 gentoo-2-d0fb555f06788f21237348022e225bcb247b058f.zip |
Add debug support, and improve init script to properly stop iscsid.
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'sys-block')
-rw-r--r-- | sys-block/open-iscsi/ChangeLog | 8 | ||||
-rw-r--r-- | sys-block/open-iscsi/Manifest | 4 | ||||
-rw-r--r-- | sys-block/open-iscsi/files/digest-open-iscsi-0.4.413-r1 | 1 | ||||
-rw-r--r-- | sys-block/open-iscsi/files/iscsid-init.d | 29 | ||||
-rw-r--r-- | sys-block/open-iscsi/open-iscsi-0.4.413-r1.ebuild | 85 |
5 files changed, 114 insertions, 13 deletions
diff --git a/sys-block/open-iscsi/ChangeLog b/sys-block/open-iscsi/ChangeLog index 94ac06cfe9c4..963039b6b316 100644 --- a/sys-block/open-iscsi/ChangeLog +++ b/sys-block/open-iscsi/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-block/open-iscsi # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/ChangeLog,v 1.3 2005/09/21 04:50:47 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/ChangeLog,v 1.4 2005/09/23 05:55:28 robbat2 Exp $ + +*open-iscsi-0.4.413-r1 (23 Sep 2005) + + 23 Sep 2005; Robin H. Johnson <robbat2@gentoo.org> files/iscsid-init.d, + +open-iscsi-0.4.413-r1.ebuild: + Add debug support, and improve init script to properly stop iscsid. 21 Sep 2005; Robin H. Johnson <robbat2@gentoo.org> files/digest-open-iscsi-0.4.413, Manifest: diff --git a/sys-block/open-iscsi/Manifest b/sys-block/open-iscsi/Manifest index 025092802c2d..aacb66f37f01 100644 --- a/sys-block/open-iscsi/Manifest +++ b/sys-block/open-iscsi/Manifest @@ -1,6 +1,8 @@ +MD5 cd6068f4214decff420fafaa58543efd open-iscsi-0.4.413-r1.ebuild 2326 MD5 88e0027844d0bb73925ed95ba41cd2ca open-iscsi-0.4.413.ebuild 2321 MD5 a0e08853157593b535d3e7b78f0a6385 ChangeLog 1050 MD5 21cd68602737d7c996bceabf6e62c468 metadata.xml 223 MD5 ec58849ae9c14ba36b99b28f204bd9be files/initiatorname.iscsi 422 MD5 20bcd1f0060b30662979dd4d9d8a9a93 files/digest-open-iscsi-0.4.413 70 -MD5 ad2618aed85b081bedd4ebcf72316183 files/iscsid-init.d 2213 +MD5 a48519990d8949f5da604e203cedfee0 files/iscsid-init.d 1976 +MD5 20bcd1f0060b30662979dd4d9d8a9a93 files/digest-open-iscsi-0.4.413-r1 70 diff --git a/sys-block/open-iscsi/files/digest-open-iscsi-0.4.413-r1 b/sys-block/open-iscsi/files/digest-open-iscsi-0.4.413-r1 new file mode 100644 index 000000000000..ffd459fa15d7 --- /dev/null +++ b/sys-block/open-iscsi/files/digest-open-iscsi-0.4.413-r1 @@ -0,0 +1 @@ +MD5 e0b90d2db7949b711c1f49d1da330cc4 open-iscsi-0.4-413.tar.gz 155241 diff --git a/sys-block/open-iscsi/files/iscsid-init.d b/sys-block/open-iscsi/files/iscsid-init.d index f08b64542189..98cffff8a138 100644 --- a/sys-block/open-iscsi/files/iscsid-init.d +++ b/sys-block/open-iscsi/files/iscsid-init.d @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2005 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-init.d,v 1.2 2005/09/20 08:00:38 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-init.d,v 1.3 2005/09/23 05:55:28 robbat2 Exp $ PID_FILE=/var/run/iscsid.pid CONFIG_FILE=/etc/iscsid.conf @@ -16,28 +16,35 @@ depend() { } checkconfig() { - [ ! -f $CONFIG_FILE ] && die "Config file $CONFIG_FILE does not exist!" - if [ ! -f $INITIATORNAME ]; then + if [ ! -f $CONFIG_FILE ]; then + eerror "Config file $CONFIG_FILE does not exist!" + return 1 + fi + if [ ! -f $INITIATORNAME -o -z "$(egrep '^InitiatorName=' "${INITIATORNAME}")" ]; then eerror "$INITIATORNAME should contain a string with your initiatior name, eg:" - errror "InitiatorName=iqn.2005-09.tld.domainname.hostname:initiator-name" - die "Initiator name file does not exist!" + eerror "InitiatorName=iqn.2005-09.tld.domainname.hostname:initiator-name" + eerror "Initiator name file does not exist!" + return 1 fi } start() { - checkconfig + checkconfig || return 1 + ebegin "Loading iSCSI modules" + modprobe scsi_transport_iscsi && modprobe iscsi_tcp + ret=$? + eend $ret + [ $ret -gt 0 ] && return $ret ebegin "Starting iSCSI initiator service" - modprobe scsi_transport_iscsi - modprobe iscsi_tcp start-stop-daemon --start --exec $DAEMON --quiet ret=$? eend $ret - [ $ret -gt 0 ] && return $ret + return $ret } stop() { ebegin "Stopping iSCSI initiator service" - start-stop-daemon --stop --quiet --exec $DAEMON --pidfile $PID_FILE + start-stop-daemon --signal HUP --stop --quiet --exec $DAEMON #--pidfile $PID_FILE eend $? # ugly, but pid file is not removed by iscsid @@ -48,7 +55,7 @@ stop() { modprobe -r scsi_transport_iscsi ret=$? eend $ret - [ $ret -gt 0 ] && return $ret + return $ret } opts="${opts} dump" diff --git a/sys-block/open-iscsi/open-iscsi-0.4.413-r1.ebuild b/sys-block/open-iscsi/open-iscsi-0.4.413-r1.ebuild new file mode 100644 index 000000000000..cd6f689a74a5 --- /dev/null +++ b/sys-block/open-iscsi/open-iscsi-0.4.413-r1.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/open-iscsi-0.4.413-r1.ebuild,v 1.1 2005/09/23 05:55:28 robbat2 Exp $ + +inherit versionator linux-mod eutils flag-o-matic + +DESCRIPTION="Open-iSCSI project is a high performance, transport independent, multi-platform implementation of RFC3720." +HOMEPAGE="http://www.open-iscsi.org/" +MY_PV="$(replace_version_separator 2 '-')" +MY_P="${PN}-${MY_PV}" +SRC_URI="mirror://gentoo/${MY_P}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~amd64" +IUSE="debug" +DEPEND="virtual/libc + virtual/linux-sources" +RDEPEND="${DEPEND} + virtual/modutils + sys-apps/util-linux" +S="${WORKDIR}/${MY_P}" + +MODULE_NAMES_ARG="kernel/drivers/scsi:${S}/kernel" +MODULE_NAMES="iscsi_tcp(${MODULE_NAMES_ARG}) scsi_transport_iscsi(${MODULE_NAMES_ARG})" +BUILD_TARGETS="all" +CONFIG_CHECK="CRYPTO_MD5 CRYPTO_CRC32C" +ERROR_CFG="open-iscsi needs both MD5 and CRC32C support in your kernel." + +src_unpack() { + unpack ${A} + convert_to_m ${S}/kernel/Makefile + export EPATCH_OPTS="-d${S}/kernel -p0" + if [ $KV_PATCH -lt 11 ]; then + die "Sorry, your kernel must be 2.6.11 or newer!" + elif [ $KV_PATCH -eq 11 ]; then + epatch ${S}/kernel/backward-compile-2.6.11.patch + elif [ $KV_PATCH -eq 12 ]; then + epatch ${S}/kernel/backward-compile-2.6.12.patch + fi + sed -i.orig \ + -e '/^CFLAGS/s,-O2,,g' \ + -e '/^CFLAGS/s,-g,,g' \ + ${S}/usr/Makefile || die "Failed to clean up CFLAGS" +} + +src_compile() { + einfo "Building kernel modules" + export KSRC="${KERNEL_DIR}" + use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI + #S=${S}/kernel + linux-mod_src_compile || die "failed to build modules" + einfo "Building userspace" + cd ${S}/usr && emake || die "emake failed" +} + +src_install() { + einfo "Installing kernel modules" + export KSRC="${KERNEL_DIR}" + #S=${S}/kernel + linux-mod_src_install + + einfo "Installing userspace" + dosbin usr/iscsid usr/iscsiadm + + doman doc/*[1-8] + dodoc README THANKS TODO + docinto test + dodoc test/* + + insinto /etc + doins etc/iscsid.conf + doins ${FILESDIR}/initiatorname.iscsi + newinitd ${FILESDIR}/iscsid-init.d iscsid + + # security + keepdir /var/db/iscsi + fperms 700 /var/db/iscsi + fperms 600 /etc/iscsid.conf +} + +pkg_postinst() { + linux-mod_pkg_postinst + [ -d /var/db/iscsi ] && chmod 700 /var/db/iscsi + [ -f /etc/iscsid.conf ] && chmod 600 /etc/iscsid.conf +} |