summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKacper Kowalik <xarthisius@gentoo.org>2012-03-14 10:07:11 +0000
committerKacper Kowalik <xarthisius@gentoo.org>2012-03-14 10:07:11 +0000
commit9b279b46d6f1df2755dc7612bd3ac4da201931de (patch)
treed1b21299772ca9b96099b56f9c12b99fb1e9fc7c
parentBlock old version of app-emulation/emul-linux-x86-soundlibs for file collisio... (diff)
downloadhistorical-9b279b46d6f1df2755dc7612bd3ac4da201931de.tar.gz
historical-9b279b46d6f1df2755dc7612bd3ac4da201931de.tar.bz2
historical-9b279b46d6f1df2755dc7612bd3ac4da201931de.zip
Allow to pass options to daemon via confd file. Fixes 408107 bug by Christian Bricart <christian@bricart.de> Improve sed to add LDFLAGS only where they're needed, respect CC properly
Package-Manager: portage-2.2.0_alpha90/cvs/Linux x86_64
-rw-r--r--sys-block/tgt/ChangeLog10
-rw-r--r--sys-block/tgt/Manifest32
-rw-r--r--sys-block/tgt/files/tgtd-1.0.24.confd4
-rw-r--r--sys-block/tgt/files/tgtd-1.0.24.initd126
-rw-r--r--sys-block/tgt/tgt-1.0.24-r1.ebuild (renamed from sys-block/tgt/tgt-1.0.24.ebuild)14
5 files changed, 164 insertions, 22 deletions
diff --git a/sys-block/tgt/ChangeLog b/sys-block/tgt/ChangeLog
index a60ebf7e2576..f7f21c92124a 100644
--- a/sys-block/tgt/ChangeLog
+++ b/sys-block/tgt/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-block/tgt
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/tgt/ChangeLog,v 1.18 2012/02/04 16:54:30 alexxy Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/tgt/ChangeLog,v 1.19 2012/03/14 10:07:11 xarthisius Exp $
+
+*tgt-1.0.24-r1 (14 Mar 2012)
+
+ 14 Mar 2012; Kacper Kowalik <xarthisius@gentoo.org> +files/tgtd-1.0.24.confd,
+ +files/tgtd-1.0.24.initd, +tgt-1.0.24-r1.ebuild, -tgt-1.0.24.ebuild:
+ Allow to pass options to daemon via confd file. Fixes 408107 bug by Christian
+ Bricart <christian@bricart.de> Improve sed to add LDFLAGS only where they're
+ needed, respect CC properly
*tgt-1.0.24 (04 Feb 2012)
diff --git a/sys-block/tgt/Manifest b/sys-block/tgt/Manifest
index 7cdc66a9b250..6e86d288b894 100644
--- a/sys-block/tgt/Manifest
+++ b/sys-block/tgt/Manifest
@@ -2,28 +2,30 @@
Hash: SHA256
AUX tgtd 3532 RMD160 fe892479c889fceed091fdba183cba019db10bb6 SHA1 c466764ce5c6270669bc207e688ecacf6dcd0a15 SHA256 a7b64cc3b5d6cd24525ce7939e460ede9860845b2b838e399eab13aa573d5248
+AUX tgtd-1.0.24.confd 108 RMD160 963b6b6a3a6946140a9b8e36a2b2a9bcaa83a0d5 SHA1 49ad792da37f746a558726fa4de37b3a439cf9c1 SHA256 39dce3ae93baca43572fc56d8d626b1b0da0eda2f39bc4f010fd1d47a863da93
+AUX tgtd-1.0.24.initd 3566 RMD160 1da028b64f8628b8f619a7289a3efa2b3614d5f2 SHA1 9a0f1a2decce5e019adb0fd6dc36daa69d3a7505 SHA256 67859625186f14f68c692ef2cf94848ea64e8bf9c1acc22c38ccf8409b69c9ed
DIST tgt-1.0.19.tar.gz 241676 RMD160 730aa50a76c6979e4dbf1d85179d14882b53e6b3 SHA1 4bb5488c72b5367201b96a86702373e3c298a419 SHA256 69fd9e9528a70c272bcc3cd00ad6754edd819a0a1ce0fad21587d33c457c6f68
DIST tgt-1.0.22.tar.gz 227522 RMD160 4439e44a3adb9d33814c32bf4b28a3a25b7cdf1a SHA1 ee77eabc97ade470a44bd5737e41878605e63d69 SHA256 a23e97d9e1bd2b5f0be06c7f441f70b8fcc98ebf1ce61b57d0e81f60c1cbcc06
DIST tgt-1.0.24.tar.gz 231583 RMD160 d5e3309710243f588852d93c60ed1c885809b047 SHA1 588c89f11975052f0dd091b15c2608fa8201b6a0 SHA256 43758d81345c176774c9ec3b823295c6b090ab60406cd47c7a636d77af4362bc
EBUILD tgt-1.0.19.ebuild 1274 RMD160 05b9d573bb89d6dc266455d1e63b734b120adab4 SHA1 34a09e86b21120f6f54764f0107d802f172a9e61 SHA256 107b6dc67b0908154d8fc6fb3fb38b63b4b2071cc0d9db23f9b9ece4a74a3272
EBUILD tgt-1.0.22.ebuild 1502 RMD160 62b80a89fd74ab09dbac5a412c6aec1799f14d23 SHA1 70be92c33b04030e370013353487251965959379 SHA256 2dbaf93df74473f1dbed0e48b73799808606df35fd91aa78ddfbe5e1391fae50
-EBUILD tgt-1.0.24.ebuild 1502 RMD160 09137cd1b612236766cbffbd20e61fcd0cf43973 SHA1 238355cfec4aec665bfc11228e75abe013528171 SHA256 9f702b3ff06adc4da502d323072a9a44f24220aaa287b18effd665bb8ea687f6
-MISC ChangeLog 2602 RMD160 2681de5663e9408a0358ed9e1f6a15ebc9b1f44f SHA1 9d54059a0c727aff7918a337f5af36f56af714b9 SHA256 595166a756ccf0de5ed62290d2a8f85e17130111180a09af564565bf44a2e04d
+EBUILD tgt-1.0.24-r1.ebuild 1585 RMD160 caf29ae4ae69e2d6aafec92f49eb7f5299043c00 SHA1 14f96b2da4f197106415db00754afa6378322e93 SHA256 7e056203e1a8377d571704b59570ff6fdf73e62c1823fd64b40b2132f3e04a78
+MISC ChangeLog 2977 RMD160 fd5bcb5544dceeb08a95bb1fbd5dbaca56da1883 SHA1 9654187073a4126b94ea595eaf91deaa8d5208b4 SHA256 8b48d963cf57c810bde1374ddaf39aa2195774afdadd1acbfd1431a972fb47f4
MISC metadata.xml 421 RMD160 18011587fe6dfa6f091eb4abda0a836c0cf68050 SHA1 7925a2004430ba88194afd6dc3419923ddffa9c3 SHA256 a03ba54467398ba953ea6073808e0f9d240c6a3da753d115b9024d816739ece2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
-iQIcBAEBCAAGBQJPLWLHAAoJEOf+E+/4L5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5VJGQxB1NmqYH20FvPSHtiAQEZpye6ZBuiZ5N58N7am
+xHtP3eWuP/IKyefPYfpg6cnYhmRZ3KNPL4ibA0RjZEMI0aAf2MOKFFPF+gSt9Wwm
+bHUj9ht7CA6RHlulqYwtOkcOLd8lN7y1LraQMNxkYiFG/CnHWBgrPYai+BgZsZ91
+5RIL5pnvdH7fkX8m8YSfMry/yXoCnfGMhgDALn+QxORQ/Ti/6G/kZtn1pkA6XWVO
+m/FbcjUqVnxbNDJ0u9ggZF6J3frcbIUmUVNMdmeAWiDu7t1XOMyPmYeAe21GweBK
+xncQ4ULTCna6tIcvYl/zYoisETyDV1xqSVAdj6q3jCDZEmsYV0LeGfwuX6DMJvcu
+CAhURllQp3nqWPskkfsL
+=IMlT
-----END PGP SIGNATURE-----
diff --git a/sys-block/tgt/files/tgtd-1.0.24.confd b/sys-block/tgt/files/tgtd-1.0.24.confd
new file mode 100644
index 000000000000..c58e9cb2a705
--- /dev/null
+++ b/sys-block/tgt/files/tgtd-1.0.24.confd
@@ -0,0 +1,4 @@
+# Here you can specify options that are passed directyl to tgt daemon
+TGTD_OPTS=""
+
+# vim: ft=gentoo-conf-d
diff --git a/sys-block/tgt/files/tgtd-1.0.24.initd b/sys-block/tgt/files/tgtd-1.0.24.initd
new file mode 100644
index 000000000000..523775eb57f6
--- /dev/null
+++ b/sys-block/tgt/files/tgtd-1.0.24.initd
@@ -0,0 +1,126 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-block/tgt/files/tgtd-1.0.24.initd,v 1.1 2012/03/14 10:07:11 xarthisius 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 -- \
+ ${TGTD_OPTS}
+ 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"
+ if [ "$TASK" != "restart" ] ; then
+ exit 1
+ fi
+ 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"
+ if [ "$TASK" != "restart" ] ; then
+ exit 1
+ fi
+ 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/tgt-1.0.24.ebuild b/sys-block/tgt/tgt-1.0.24-r1.ebuild
index 7ea934a217bc..6ed63c07c14f 100644
--- a/sys-block/tgt/tgt-1.0.24.ebuild
+++ b/sys-block/tgt/tgt-1.0.24-r1.ebuild
@@ -1,10 +1,10 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/tgt/tgt-1.0.24.ebuild,v 1.1 2012/02/04 16:54:30 alexxy Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/tgt/tgt-1.0.24-r1.ebuild,v 1.1 2012/03/14 10:07:11 xarthisius Exp $
EAPI=4
-inherit flag-o-matic linux-info
+inherit flag-o-matic linux-info toolchain-funcs
MY_TREE="e039354"
@@ -26,19 +26,20 @@ DEPEND="dev-perl/config-general
RDEPEND="${DEPEND}
sys-apps/sg3_utils"
-S="${WORKDIR}"/fujita-tgt-"${MY_TREE}"
+S=${WORKDIR}/fujita-tgt-${MY_TREE}
pkg_setup() {
CONFIG_CHECK="~SCSI_TGT"
WARNING_SCSI_TGT="Your kernel needs CONFIG_SCSI_TGT"
linux-info_pkg_setup
+ tc-export CC
}
src_prepare() {
- sed -i -e 's:\($(CC)\):\1 $(LDFLAGS):' usr/Makefile || die "sed failed"
+ sed -i -e 's:\($(CC)\) $^:\1 $(LDFLAGS) $^:' usr/Makefile || die
# make sure xml docs are generated before trying to install them
- sed -i -e "s@install: @install: all @g" doc/Makefile || die
+ sed -i -e "s@install: @& all @g" doc/Makefile || die
}
src_compile() {
@@ -54,7 +55,8 @@ src_compile() {
src_install() {
emake install-programs install-scripts install-doc DESTDIR="${D}" \
docdir=/usr/share/doc/${PF}
- doinitd "${FILESDIR}/tgtd"
+ newinitd "${FILESDIR}"/tgtd-${PV}.initd tgtd
+ newconfd "${FILESDIR}"/tgtd-${PV}.confd tgtd
dodir /etc/tgt
keepdir /etc/tgt
}