diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2008-07-18 16:03:38 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2008-07-18 16:03:38 +0000 |
commit | 7c5f29fd932528bccf0b4b7babf5580963da4fc9 (patch) | |
tree | 9793fd964116382cb1df75e83f9da3104471cb2c /sys-block | |
parent | Remove useless autotools inherit (diff) | |
download | gentoo-2-7c5f29fd932528bccf0b4b7babf5580963da4fc9.tar.gz gentoo-2-7c5f29fd932528bccf0b4b7babf5580963da4fc9.tar.bz2 gentoo-2-7c5f29fd932528bccf0b4b7babf5580963da4fc9.zip |
Add a snapshot of current SVN for iscsitarget, this has the proper fixes for glibc 2.8 rather than our hacks, and also builds and runs fine with kernel 2.6.26. Also update to the new init script provided by Natanael Copa in bug #197472 that is POSIX compatible.
(Portage version: 2.2_rc1/cvs/Linux 2.6.26-gentoo x86_64)
Diffstat (limited to 'sys-block')
-rw-r--r-- | sys-block/iscsitarget/ChangeLog | 12 | ||||
-rw-r--r-- | sys-block/iscsitarget/files/ietd-init.d-2 | 106 | ||||
-rw-r--r-- | sys-block/iscsitarget/files/iscsitarget-0.4.17-build.patch | 23 | ||||
-rw-r--r-- | sys-block/iscsitarget/iscsitarget-0.4.16_p162.ebuild | 57 |
4 files changed, 197 insertions, 1 deletions
diff --git a/sys-block/iscsitarget/ChangeLog b/sys-block/iscsitarget/ChangeLog index b6f99a4a24ba..bd01f67a1e9e 100644 --- a/sys-block/iscsitarget/ChangeLog +++ b/sys-block/iscsitarget/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for sys-block/iscsitarget # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/ChangeLog,v 1.13 2008/06/14 08:18:53 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/ChangeLog,v 1.14 2008/07/18 16:03:37 flameeyes Exp $ + +*iscsitarget-0.4.16_p162 (18 Jul 2008) + + 18 Jul 2008; Diego Pettenò <flameeyes@gentoo.org> + +files/iscsitarget-0.4.17-build.patch, +files/ietd-init.d-2, + +iscsitarget-0.4.16_p162.ebuild: + Add a snapshot of current SVN for iscsitarget, this has the proper fixes + for glibc 2.8 rather than our hacks, and also builds and runs fine with + kernel 2.6.26. Also update to the new init script provided by Natanael + Copa in bug #197472 that is POSIX compatible. *iscsitarget-0.4.16 (14 Jun 2008) diff --git a/sys-block/iscsitarget/files/ietd-init.d-2 b/sys-block/iscsitarget/files/ietd-init.d-2 new file mode 100644 index 000000000000..6ea9a4b51e80 --- /dev/null +++ b/sys-block/iscsitarget/files/ietd-init.d-2 @@ -0,0 +1,106 @@ +#!/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/iscsitarget/files/ietd-init.d-2,v 1.1 2008/07/18 16:03:38 flameeyes Exp $ + +MEM_SIZE=1048576 +DAEMON=/usr/sbin/ietd +CONFIG_FILE=/etc/ietd.conf +PID_FILE=/var/run/iscsi_trgt.pid +NAME="iSCSI Enterprise Target" + +ARGS="" +[ -n "$USER" ] && ARGS="${ARGS} --uid=${USER}" +[ -n "$GROUP" ] && ARGS="${ARGS} --gid=${GROUP}" +[ -n "$ISNS" ] && ARGS="${ARGS} --isns=${ISNS}" +[ -n "$PORT" ] && ARGS="${ARGS} --port=${PORT}" +[ -n "$ADDRESS" ] && ARGS="${ARGS} --address=${ADDRESS}" +[ -n "$DEBUGLEVEL" ] && ARGS="${ARGS} --debug=${DEBUGLEVEL}" + +depend() { + use net + after modules +} +checkconfig() { + if [ ! -f $CONFIG_FILE ]; then + eerror "Config file $CONFIG_FILE does not exist!" + return 1 + fi + if [ -z "$DISABLE_MEMORY_WARNINGS" ]; then + check_memsize + fi +} + +check_memsize() { + local wr md sysctl_key v k + for wr in r w; do + for md in max default; do + sysctl_key="net.core.${wr}mem_${md}" + v="$(sysctl -n ${sysctl_key})" + if [ "${v}" -lt "${MEM_SIZE}" ]; then + ewarn "$sysctl_key ($v) is lower than recommended ${MEM_SIZE}" + fi + done + done + for wr in "" r w; do + sysctl_key="net.ipv4.tcp_${wr}mem" + set -- $(sysctl -n ${sysctl_key}) + for k in min default max ; do + if [ "${1}" -lt "${MEM_SIZE}" ]; then + ewarn "$sysctl_key:$k (${1}) is lower than recommended ${MEM_SIZE}" + fi + shift + done + done +} + +do_modules() { + msg="$1" + shift + modules="$1" + shift + opts="$@" + for m in ${modules}; do + ebegin "${msg} - ${m}" + modprobe ${opts} $m + ret=$? + eend $ret + [ $ret -ne 0 ] && return $ret + done + return 0 +} + +start() { + checkconfig || return 1 + do_modules 'Loading iSCSI-Target modules' 'iscsi_trgt' + ebegin "Starting ${NAME}" + start-stop-daemon --start --exec $DAEMON --quiet -- ${ARGS} + eend $? +} + +stop() { + ebegin "Removing ${NAME} devices" + # ugly, but ietadm does not allways provides correct exit values + RETURN="$(ietadm --op delete 2>&1)" + RETVAL=$? + if [ $RETVAL -eq 0 ] && [ "$RETURN" != "something wrong" ] ; then + eend 0 + else + eend 1 + eerror "ietadm failed - $RETURN" + return 1 + fi + + ebegin "Stopping ${NAME}" + start-stop-daemon --stop --quiet --exec $DAEMON --pidfile $PID_FILE + ret=$? + eend $ret + [ $ret -ne 0 ] && return 1 + + # ugly, but pid file is not removed by ietd + rm -f $PID_FILE + do_modules 'Removing iSCSI-Target modules' 'iscsi_trgt' '-r' + return $? +} + +# vim: tw=72: diff --git a/sys-block/iscsitarget/files/iscsitarget-0.4.17-build.patch b/sys-block/iscsitarget/files/iscsitarget-0.4.17-build.patch new file mode 100644 index 000000000000..e984bd3ec374 --- /dev/null +++ b/sys-block/iscsitarget/files/iscsitarget-0.4.17-build.patch @@ -0,0 +1,23 @@ +--- usr/Makefile ++++ usr/Makefile +@@ -1,16 +1,15 @@ +-CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include ++CFLAGS ?= -O2 -fno-inline -g + CFLAGS += -D_GNU_SOURCE # required for glibc >= 2.8 ++WARNFLAGS = -Wall -Wstrict-prototypes ++CFLAGS += $(WARNFLAGS) -I../include + PROGRAMS = ietd ietadm +-LIBS = -lcrypto ++LDLIBS = -lcrypto + + all: $(PROGRAMS) + + ietd: ietd.o iscsid.o conn.o session.o target.o message.o ctldev.o log.o chap.o event.o param.o plain.o isns.o + +- $(CC) $^ -o $@ $(LIBS) +- + ietadm: ietadm.o param.o +- $(CC) $^ -o $@ + + clean: + rm -f *.o $(PROGRAMS) diff --git a/sys-block/iscsitarget/iscsitarget-0.4.16_p162.ebuild b/sys-block/iscsitarget/iscsitarget-0.4.16_p162.ebuild new file mode 100644 index 000000000000..aba2ec483430 --- /dev/null +++ b/sys-block/iscsitarget/iscsitarget-0.4.16_p162.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/iscsitarget-0.4.16_p162.ebuild,v 1.1 2008/07/18 16:03:37 flameeyes Exp $ + +inherit linux-mod eutils flag-o-matic + +DESCRIPTION="Open Source iSCSI target with professional features" +HOMEPAGE="http://iscsitarget.sourceforge.net/" +SRC_URI="mirror://gentoo/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="" + +DEPEND="dev-libs/openssl" + +MODULE_NAMES="iscsi_trgt(kernel/iscsi:${S}/kernel)" +CONFIG_CHECK="CRYPTO_CRC32C" +ERROR_CFG="iscsitarget needs support for CRC32C in your kernel." + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${PN}-0.4.15-isns-set-scn-flag.patch #180619 + epatch "${FILESDIR}"/${PN}-0.4.17-build.patch + convert_to_m "${S}"/Makefile +} + +src_compile() { + emake usr || die "failed to build userspace" + + unset ARCH + emake KSRC="${KERNEL_DIR}" kernel || die "failed to build module" +} + +src_install() { + einfo "Installing userspace" + dosbin usr/ietd usr/ietadm || die "dosbin failed" + insinto /etc + doins etc/ietd.conf etc/initiators.{allow,deny} || die "doins failed" + # Upstream's provided Gentoo init script is out of date compared to + # their Debian init script. And isn't that nice. + #newinitd etc/initd/initd.gentoo ietd || die + newinitd "${FILESDIR}"/ietd-init.d-2 ietd || die "newinitd failed" + newconfd "${FILESDIR}"/ietd-conf.d ietd || die "newconfd failed" + + # Lock down perms, per bug 198209 + fperms 0640 /etc/ietd.conf /etc/initiators.{allow,deny} + + doman doc/manpages/*.[1-9] || die "manpages failed" + dodoc ChangeLog README || die "docs failed" + + einfo "Installing kernel module" + unset ARCH + linux-mod_src_install || die "modules failed" +} |