diff options
author | Alexey Shvetsov <alexxy@gentoo.org> | 2009-11-25 16:33:12 +0000 |
---|---|---|
committer | Alexey Shvetsov <alexxy@gentoo.org> | 2009-11-25 16:33:12 +0000 |
commit | 13b094de2fae951cb7c5232ea53ec5737f67d7a3 (patch) | |
tree | 34b23384a26a589fc8aca984c7ce105fd49b18af /sys-block | |
parent | Automated update of use.local.desc (diff) | |
download | historical-13b094de2fae951cb7c5232ea53ec5737f67d7a3.tar.gz historical-13b094de2fae951cb7c5232ea53ec5737f67d7a3.tar.bz2 historical-13b094de2fae951cb7c5232ea53ec5737f67d7a3.zip |
[sys-block/tgt] Initial import per bug #228729
Package-Manager: portage-2.2_rc51/cvs/Linux x86_64
Diffstat (limited to 'sys-block')
-rw-r--r-- | sys-block/tgt/ChangeLog | 10 | ||||
-rw-r--r-- | sys-block/tgt/Manifest | 15 | ||||
-rw-r--r-- | sys-block/tgt/files/tgtd | 127 | ||||
-rw-r--r-- | sys-block/tgt/metadata.xml | 15 | ||||
-rw-r--r-- | sys-block/tgt/tgt-0.9.10.ebuild | 42 |
5 files changed, 209 insertions, 0 deletions
diff --git a/sys-block/tgt/ChangeLog b/sys-block/tgt/ChangeLog new file mode 100644 index 000000000000..22cb14d04124 --- /dev/null +++ b/sys-block/tgt/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for sys-block/tgt +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/tgt/ChangeLog,v 1.1 2009/11/25 16:33:11 alexxy Exp $ + +*tgt-0.9.10 (25 Nov 2009) + + 25 Nov 2009; Alexey Shvetsov <alexxy@gentoo.org> +tgt-0.9.10.ebuild, + +files/tgtd, +metadata.xml: + Initial import per bug + diff --git a/sys-block/tgt/Manifest b/sys-block/tgt/Manifest new file mode 100644 index 000000000000..836ba63291db --- /dev/null +++ b/sys-block/tgt/Manifest @@ -0,0 +1,15 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX tgtd 3497 RMD160 9d5879263cd154d44429413d5e509ed51c980940 SHA1 3ede20bb7bfea2b8130565e987d50ecc128e466e SHA256 5c6e599c63d3c8a0567b5d1eed7fb470c8dac1fe0f7a90b15cc37a92a8f5788c +DIST tgt-0.9.10.tar.bz2 239870 RMD160 bc5a7a12c732ac5c70c4571a9efd1a6788e7d59d SHA1 55e9f40b515112988ff960a6ba6ca8c0204e3def SHA256 f30ffe64bcf4fc8a82a76594c254ce54c82a33d797cdc0f35f19519572f94c4a +EBUILD tgt-0.9.10.ebuild 1084 RMD160 60cc9e8730217c22d10bc7486b72bf72f181efba SHA1 b6b8123c376a01e6947258052fa7a42a12bb16cd SHA256 09d46e239f83820d27019f9a5a1ebbc4246a62be8833df5a9cfa7968952e8163 +MISC ChangeLog 353 RMD160 55585403f8bb54f6ea0c4184b8ee7b9dba5c0ac4 SHA1 fcb5740cfc96240570b9398a3d188bf4faf206d5 SHA256 08995db0e534ca613721ec42014f6b9d0600f60dab31b0722ed0261eec893f45 +MISC metadata.xml 543 RMD160 b0d3677bf1fba5558a59be35c20b13145eb23857 SHA1 42d2e81ccbe31a14effdef6282dc4941eb1dadc5 SHA256 aae4c8747ac788f5ddeb7c6a5d5f33adb83c7606a3974ce7396e198431544de9 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.13 (GNU/Linux) + +iEYEARECAAYFAksNXFkACgkQ5BmOA85PVLjw0wCfZqvXpE2QrOFnYVleMH+2duxA +POgAoKWmJv5UyvS5dLGD6sT71qhCzwEc +=h1nl +-----END PGP SIGNATURE----- diff --git a/sys-block/tgt/files/tgtd b/sys-block/tgt/files/tgtd new file mode 100644 index 000000000000..cbf209ed54f4 --- /dev/null +++ b/sys-block/tgt/files/tgtd @@ -0,0 +1,127 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/tgt/files/tgtd,v 1.1 2009/11/25 16:33:12 alexxy Exp $ + +TGTD_CONFIG=/etc/tgt/targets.conf + +TASK=$1 + +depend() { + need net +} + +start() +{ + ebegin "Starting target framework daemon" + ebegin "Starting ${SVCNAME}" + # Start tgtd first. + start-stop-daemon --start --quiet \ + --name tgtd \ + --exec /usr/sbin/tgtd + RETVAL=$? + if [ "$RETVAL" -ne 0 ] ; then + echo "Could not start tgtd (is tgtd already running?)" + exit 1 + fi + # We need to wait for 1 second before do anything with tgtd + sleep 1 + # Put tgtd into "offline" state until all the targets are configured. + # We don't want initiators to (re)connect and fail the connection + # if it's not ready + tgtadm --op update --mode sys --name State -v offline + # Configure the targets. + tgt-admin --update ALL -c $TGTD_CONFIG + # Put tgtd into "ready" state. + tgtadm --op update --mode sys --name State -v ready + eend $? +} + +stop() +{ + ebegin "Stopping ${SVCNAME}" + ebegin "Stopping target framework daemon" + # start-stop-daemon --stop --exec /usr/sbin/tgtd --quiet + if [ "$RUNLEVEL" == 0 -o "$RUNLEVEL" == 6 ] ; then + forcedstop + fi + # Remove all targets. It only removes targets which are not in use. + tgt-admin --update ALL -c /dev/null &>/dev/null + # tgtd will exit if all targets were removed + tgtadm --op delete --mode system &>/dev/null + RETVAL=$? + if [ "$RETVAL" -eq 107 ] ; then + echo "tgtd is not running" + [ "$TASK" != "restart" ] && exit 1 + elif [ "$RETVAL" -ne 0 ] ; then + echo "Some initiators are still connected - could not stop tgtd" + exit 2 + fi + # echo -n + eend $? +} + +forcedstop() +{ + # NOTE: Forced shutdown of the iscsi target may cause data corruption + # for initiators that are connected. + echo "Force-stopping target framework daemon" + # Offline everything first. May be needed if we're rebooting, but + # expect the initiators to reconnect cleanly when we boot again + # (i.e. we don't want them to reconnect to a tgtd which is still + # working, but the target is gone). + tgtadm --op update --mode sys --name State -v offline &>/dev/null + RETVAL=$? + if [ "$RETVAL" -eq 107 ] ; then + echo "tgtd is not running" + [ "$TASK" != "restart" ] && exit 1 + else + tgt-admin --offline ALL + # Remove all targets, even if they are still in use. + tgt-admin --update ALL -c /dev/null -f + # It will shut down tgtd only after all targets were removed. + tgtadm --op delete --mode system + RETVAL=$? + if [ "$RETVAL" -ne 0 ] ; then + echo "Failed to shutdown tgtd" + exit 1 + fi + fi + echo -n +} + +reload() +{ + echo "Updating target framework daemon configuration" + # Update configuration for targets. Only targets which + # are not in use will be updated. + tgt-admin --update ALL -c $TGTD_CONFIG &>/dev/null + RETVAL=$? + if [ "$RETVAL" -eq 107 ] ; then + echo "tgtd is not running" + exit 1 + fi +} + +forcedreload() +{ + echo "Force-updating target framework daemon configuration" + # Update configuration for targets, even those in use. + tgt-admin --update ALL -f -c $TGTD_CONFIG &>/dev/null + RETVAL=$? + if [ "$RETVAL" -eq 107 ] ; then + echo "tgtd is not running" + exit 1 + fi +} + +status() +{ + # Don't name this script "tgtd"... + TGTD_PROC=$(ps -C tgtd | grep -c tgtd) + if [ "$TGTD_PROC" -eq 2 ] ; then + echo "tgtd is running. Run 'tgt-admin -s' to see detailed target info." + else + echo "tgtd is NOT running." + fi +} diff --git a/sys-block/tgt/metadata.xml b/sys-block/tgt/metadata.xml new file mode 100644 index 000000000000..c7f81ebfd167 --- /dev/null +++ b/sys-block/tgt/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>cluster</herd> +<longdescription> +iSCSI Target daemon with rdma support +</longdescription> +<use> + <flag name='ibmvio'>Add support for IBM Virtual I/O</flag> + <flag name='infiniband'>Add support for iSCSI over RDMA (iser). All needed + libs can be found in science overlay</flag> + <flag name='fcp'>Add support for new FC protocol</flag> + <flag name='fcoe'>Add support for FCoE protocol</flag> +</use> +</pkgmetadata> diff --git a/sys-block/tgt/tgt-0.9.10.ebuild b/sys-block/tgt/tgt-0.9.10.ebuild new file mode 100644 index 000000000000..89c73a8a19f9 --- /dev/null +++ b/sys-block/tgt/tgt-0.9.10.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/tgt/tgt-0.9.10.ebuild,v 1.1 2009/11/25 16:33:11 alexxy Exp $ + +EAPI="2" + +inherit flag-o-matic linux-info + +DESCRIPTION="Linux SCSI target framework (tgt)" +HOMEPAGE="http://stgt.berlios.de/" +SRC_URI="http://stgt.berlios.de/releases/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="ibmvio infiniband fcp fcoe" + +DEPEND="dev-perl/config-general + infiniband? ( + sys-infiniband/libibverbs + sys-infiniband/librdmacm + )" +RDEPEND="${DEPEND} + sys-apps/sg3_utils" + +src_configure() { + local myconf + use ibmvio && myconf="${myconf} IBMVIO=1" + use infiniband && myconf="${myconf} ISCSI_RDMA=1" + use fcp && myconf="${myconf} FCP=1" + use fcoe && myconf="${myconf} FCOE=1" +} + +src_compile() { + emake -C usr/ KERNELSRC="${KERNEL_DIR}" ISCSI=1 ${myconf} +} + +src_install() { + emake -C usr/ install DESTDIR="${D}" || die "install failed" + doinitd "${FILESDIR}/tgtd" + dodoc doc/README.* doc/targets.conf.example doc/tmf.txt +} |