* [gentoo-commits] dev/alexxy:master commit in: sys-block/lio-utils/files/, sys-block/lio-utils/
@ 2011-08-12 14:28 Alexey Shvetsov
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Shvetsov @ 2011-08-12 14:28 UTC (permalink / raw
To: gentoo-commits
commit: 2a6b76082c2ba91fc0ed5b46aa6b9643e33cb838
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 12 14:27:32 2011 +0000
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Fri Aug 12 14:27:32 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/alexxy.git;a=commit;h=2a6b7608
[sys-block/lio-utils] Initial import
(Portage version: 2.2.0_alpha50/git/Linux x86_64, signed Manifest commit with key F82F92E6)
---
sys-block/lio-utils/Manifest | 24 +++++++
sys-block/lio-utils/files/snmp-makefile.patch | 22 ++++++
sys-block/lio-utils/files/tools-makefile.patch | 8 ++
sys-block/lio-utils/lio-utils-9999.ebuild | 88 ++++++++++++++++++++++++
sys-block/lio-utils/metadata.xml | 8 ++
5 files changed, 150 insertions(+), 0 deletions(-)
diff --git a/sys-block/lio-utils/Manifest b/sys-block/lio-utils/Manifest
new file mode 100644
index 0000000..fae2e68
--- /dev/null
+++ b/sys-block/lio-utils/Manifest
@@ -0,0 +1,24 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+AUX snmp-makefile.patch 615 RMD160 bbd6c2a38bf89b7f41932359fada74531f72533f SHA1 f362e04dad801ef016c1442da795c81d3d1895e0 SHA256 f03463d4577faacb7a8f8974c8ab00555772cf9746132dba848009a1b702241f
+AUX tools-makefile.patch 280 RMD160 191099d43bad165261bb7b3c5a05c5b8256efb7a SHA1 950f9d3c3e2e5bdb12ede7a7c9159b9e562bffe9 SHA256 99c7b1e467f95b70781c0e43d63d2f3b1ac0aac75662c55009970652255e6fd9
+EBUILD lio-utils-9999.ebuild 1922 RMD160 5d07f5e34f6784aebccde74adf125b2a69bebb2d SHA1 6267a3584cbd9fe3875116ab6eb2ea1d707cb522 SHA256 39f4c22aaab39d290c87412f90d60854d8cc6d5549c4a62111f485d499861900
+MISC metadata.xml 245 RMD160 bb90c6c2a534f0a7f72a472afdcfe4f2521b37c3 SHA1 d36c31899ea7f31a40aeafbf07d33517a701a1db SHA256 19e93016c44ea06640369073a79690cddca798d46f95351caa3d18adf6680715
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.18 (GNU/Linux)
+
+iQIcBAEBCAAGBQJORThUAAoJEOf+E+/4L5Lmg6IP/1RMrcl+6B+CZUGc6QiOctCQ
+yitT+KOoNJkLwfVBtHvmJyXEZewmJQwgNbO2MtSujkt20lhRsNldwtl3a4dllE3d
+T5IMeXMBNpOlD+FTvcQr8k/rlthkiWgnRYl6AtzRv8Zy7o9Gf8rWGInD7uTqQvnq
++DqbpoWpu+BgGfU3yqBTdmqXIfCEoqQmpu8RjWEfPevzhgz8TI2lGPgfaO+d4deW
+d94b/4MJ0gQn0E9bEGhPF6J8zBWFQM6AYtm2X7PWrhxmUQxcxtTiy8WWR8XJz7ca
+0W1zWsWLr0XQkBYMDIgGaKBAcFL0qn+oUa6pMkSaTJ4HZ8uyoSLWOAbFsRannDzo
+NWgNhS1rTKSADSzv89nujlBdvHK73G4BivYc57LBeI3mCRH96VOgVZSwgZJi5OvB
+SomLnnZmWUTGkgWFJS1fRTpKFvyEmAwBZlpL6g+sc7pehX1pmcdPfxMcLQsnH9tH
+wAWD7vD4+cbag1h2VwZF2VdZAYvgFKDGYGV6+U9j0ilzd8tHynNEqcAiwA8wc+fc
+itx2hcYv/GK8bQokh9Hc1Z5pDO4nw6L4d4e9NvCU4kICEQXN9Yn+IMeQkTTIh+Mh
+ICn51g0dQolq1HE/RUuy8Rc4uhYlotx2HSLceNJvjqr/xMCK/5i7aSKPieN8EfVI
+MwHg8M3DH/7qF3cTT8gF
+=WtcJ
+-----END PGP SIGNATURE-----
diff --git a/sys-block/lio-utils/files/snmp-makefile.patch b/sys-block/lio-utils/files/snmp-makefile.patch
new file mode 100644
index 0000000..f9301ae
--- /dev/null
+++ b/sys-block/lio-utils/files/snmp-makefile.patch
@@ -0,0 +1,22 @@
+--- mib-modules/Makefile.old 2011-06-21 00:26:30.000000000 +0400
++++ mib-modules/Makefile 2011-06-21 00:29:28.000000000 +0400
+@@ -18,8 +18,8 @@
+ iscsiAuthData.o
+
+ CC = gcc
+-CFLAGS = -I$(INCLDIR) -I$(INCLDIR)/agent -I$(INCLDIR)/agent/mibgroup -shared -fPIC
+-CFLAGS += -I../include -Wall -Werror
++INCLUDES = -I$(INCLDIR) -I$(INCLDIR)/agent -I$(INCLDIR)/agent/mibgroup
++INCLUDES += -I../include
+ #CFLAGS +=$(AUTO_CFLAGS)
+
+ LD = gcc -shared
+@@ -29,7 +29,7 @@
+ all: $(TARG)
+
+ %.o: %.c *.h
+- $(CC) $(CFLAGS) -o $@ -c $<
++ $(CC) -fPIC $(INCLUDES) $(CFLAGS) -o $@ -c $<
+
+ $(TARG): $(OBJS)
+ $(LD) -o $@ $(OBJS)
diff --git a/sys-block/lio-utils/files/tools-makefile.patch b/sys-block/lio-utils/files/tools-makefile.patch
new file mode 100644
index 0000000..d9ee040
--- /dev/null
+++ b/sys-block/lio-utils/files/tools-makefile.patch
@@ -0,0 +1,8 @@
+--- tools/Makefile 2011-06-20 23:25:07.000000000 +0400
++++ tools/Makefile 2011-06-21 00:06:26.000000000 +0400
+@@ -12,4 +12,5 @@
+ rm -f $(ISCSI_NAME_OBJS) $(ISCSI_NAME)
+
+ install:
++ mkdir -p $(DESTDIR)/usr/sbin
+ install -m 0755 $(ISCSI_NAME) $(DESTDIR)/usr/sbin/iscsi-name
diff --git a/sys-block/lio-utils/lio-utils-9999.ebuild b/sys-block/lio-utils/lio-utils-9999.ebuild
new file mode 100644
index 0000000..b5f6fc2
--- /dev/null
+++ b/sys-block/lio-utils/lio-utils-9999.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=3
+
+EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/storage/lio/lio-utils.git"
+PYTHON_DEPEND="2"
+RESTRICT_PYTHON_ABIS="3.*"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit eutils distutils git-2 python
+
+DESCRIPTION="Tools for controlling target_core_mod/ConfigFS"
+HOMEPAGE="http://linux-iscsi.org/"
+SRC_URI=""
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS=""
+IUSE="snmp"
+
+DEPEND="snmp? ( net-analyzer/net-snmp )"
+RDEPEND="${DEPEND}"
+
+src_prepare(){
+ local module
+
+ for module in tcm-py lio-py; do
+ cd ${module}
+ distutils_src_prepare
+ cd ..
+ done
+ epatch "${FILESDIR}"/tools-makefile.patch
+ epatch "${FILESDIR}"/snmp-makefile.patch
+}
+
+src_compile(){
+ local module
+
+ for module in tcm-py lio-py; do
+ cd ${module}
+ distutils_src_compile
+ cd ..
+ done
+ cd tools/
+ emake || die "emake failed"
+ cd ..
+ if use snmp; then
+ cd mib-modules/
+ emake || die "emake snmp failed"
+ cd ..
+ fi
+}
+
+src_install(){
+ local module
+
+ for module in tcm-py lio-py; do
+ cd ${module}
+ distutils_src_install
+ cd ..
+ done
+ cd tools/
+ emake DESTDIR="${ED}" install || die "emake install failed"
+ cd ..
+
+ symlink_to_sbin(){
+ local ver=$(python_get_version) sitedir="$(python_get_sitedir)"
+ ln -s "${sitedir}"/lio_dump.py \
+ "${ED}"/usr/sbin/lio_dump-${ver}
+ python_convert_shebangs "${ver}" "${D}${sitedir}"/lio_dump.py
+ ln -s "${sitedir}"/lio_node.py \
+ "${ED}"/usr/sbin/lio_node-${ver}
+ python_convert_shebangs "${ver}" "${D}${sitedir}"/lio_node.py
+ }
+ python_execute_function --action-message "Making symlinks to /usr/sbin" symlink_to_sbin
+ python_generate_wrapper_scripts "${ED}"/usr/sbin/{lio_dump,lio_node}
+
+ if use snmp; then
+ cd mib-modules/
+ emake DESTDIR="${ED}" install || die "emake install snmp failed"
+ cd ..
+ fi
+
+ emake DESTDIR="${ED}" conf_install || die "emake conf_install failed"
+ #Handle initscripts here
+}
diff --git a/sys-block/lio-utils/metadata.xml b/sys-block/lio-utils/metadata.xml
new file mode 100644
index 0000000..ed40431
--- /dev/null
+++ b/sys-block/lio-utils/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>cluster</herd>
+<longdescription>
+ Tools for controlling target_core_mod/ConfigFS
+</longdescription>
+</pkgmetadata>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] dev/alexxy:master commit in: sys-block/lio-utils/files/, sys-block/lio-utils/
@ 2012-04-10 13:46 Alexey Shvetsov
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Shvetsov @ 2012-04-10 13:46 UTC (permalink / raw
To: gentoo-commits
commit: 120dddc7a32fd78a63c83b2195d17d37693ff6ab
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 10 13:46:40 2012 +0000
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Tue Apr 10 13:46:40 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/alexxy.git;a=commit;h=120dddc7
Add initd for lio-utils
(Portage version: 2.2.0_alpha100/git/Linux x86_64, unsigned Manifest commit)
---
sys-block/lio-utils/files/target.initd | 137 +++++++++++++++++++++++++++++
sys-block/lio-utils/lio-utils-9999.ebuild | 7 +-
2 files changed, 142 insertions(+), 2 deletions(-)
diff --git a/sys-block/lio-utils/files/target.initd b/sys-block/lio-utils/files/target.initd
new file mode 100644
index 0000000..f7d7e4f
--- /dev/null
+++ b/sys-block/lio-utils/files/target.initd
@@ -0,0 +1,137 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+description="Linux-iSCSI.org target"
+
+depend() {
+ after modules
+ use net
+}
+
+MODNAME="target_core_mod"
+
+TCM_CFS_DIR="/sys/kernel/config/target/core"
+LIO_CFS_DIR="/sys/kernel/config/target/iscsi"
+TCM_NODE="/usr/sbin/tcm_node"
+LIO_NODE="/usr/sbin/lio_node"
+TCM_FABRIC="/usr/sbin/tcm_fabric"
+CONFIGFS_SCRIPT_DIR="/etc/target"
+TCM_CONFIGFS_SCRIPT="/etc/target/tcm_start.sh"
+LIO_CONFIGFS_SCRIPT="/etc/target/lio_start.sh"
+TCM_CORE_MODULE="target_core_mod"
+TCM_CORE_IO_MODULES="target_core_iblock target_core_file target_core_pscsi"
+FABRICS_MODULES="tcm_fc tcm_loop ib_srpt"
+LIO_MODULE="iscsi_target_mod"
+
+checkconfig() {
+ if ! modinfo ${TCM_CORE_MODULE} > /dev/null 2>&1 ; then
+ eerror "Target Core modules not found!"
+ return 1
+ elif ! modinfo ${LIO_MODULE} > /dev/null 2>&1 ; then
+ eerror "Linux iSCSI modules not found!"
+ return 1
+ elif [ ! -f ${TCM_CONFIGFS_SCRIPT} ]; then
+ eerror "${TCM_CONFIGFS_SCRIPT} does not exist. run targetcli to configure your target!"
+ return 1
+ elif [ ! -f ${LIO_CONFIGFS_SCRIPT} ]; then
+ eerror "${LIO_CONFIGFS_SCRIPT} does not exist. run targetcli to configure your target!"
+ return 1
+ fi
+}
+
+fabrics_start() {
+ ebegin "Starting Targets: "
+ for module in ${FABRICS_MODULES}; do
+ if modinfo $module > /dev/null 2>&1 ; then
+ ebegin "Loading ${module}"
+ modprobe ${module}
+ eend $?
+ fi
+ done
+ for cfgscript in ${CONFIGFS_SCRIPT_DIR}/*.sh; do
+ if [ ! -f ${cfgscript} ]; then
+ continue
+ fi
+ # target core is handled in tcm_start
+ if [ ${cfgscript} == ${TCM_CONFIGFS_SCRIPT} ]; then
+ continue
+ fi
+ # iscsi-target fabric module is handled in lio_target_start
+ if [ ${cfgscript} == ${LIO_CONFIGFS_SCRIPT} ]; then
+ continue
+ fi
+ ebegin "Calling ConfigFS script $cfgscript: "
+ sh ${cfgscript} > /dev/null 2>&1
+ eend $?
+ done
+ eend $?
+}
+
+lio_target_start() {
+ ebegin "Loading iSCSI target modules: ${LIO_MODULE}"
+ modprobe ${LIO_MODULE}
+ eend $?
+ ebegin "Configuring iSCSI target iscsi_target_mod"
+ sh ${LIO_CONFIGFS_SCRIPT} > /dev/null 2>&1
+ eend $?
+}
+
+tcm_start() {
+ ebegin "Loading Target Core modules : ${TCM_CORE_MODULE}"
+ modprobe ${TCM_CORE_MODULE}
+ eend $?
+ ebegin "Loading Target Core backend modules: "
+ for module in ${TCM_CORE_IO_MODULES} ; do
+ ebegin "${module}"
+ modprobe ${module}
+ eend $?
+ done
+ eend $?
+ ebegin "Calling ConfigFS script $TCM_CONFIGFS_SCRIPT for target_core_mod"
+ sh ${TCM_CONFIGFS_SCRIPT} > /dev/null 2>&1
+ eend $?
+}
+
+lio_target_stop() {
+ ebegin "Unload Linux-iSCSI.org Fabric module"
+ ${LIO_NODE} --unload
+ eend $?
+}
+
+fabrics_stop() {
+ ebegin "Unloading misc fabric modules: "
+ ${TCM_FABRIC} --unloadall
+ eend $?
+}
+
+tcm_stop() {
+ ebegin "Unloading Target Core modules: "
+ $TCM_NODE --unload
+ eend $?
+}
+
+start() {
+ checkconfig
+ tcm_start
+ lio_target_start
+ fabrics_start
+}
+
+stop() {
+ lio_target_stop
+ fabrics_stop
+ tcm_stop
+}
+
+status() {
+ einfo "Target core mode status"
+ tcm_node --listhbas
+ einfo ""
+ einfo "Linux iSCSI status"
+ lio_node --listendpoints
+ einfo ""
+ lio_node --version
+ tcm_node --version
+}
diff --git a/sys-block/lio-utils/lio-utils-9999.ebuild b/sys-block/lio-utils/lio-utils-9999.ebuild
index 84d20f7..e4c7215 100644
--- a/sys-block/lio-utils/lio-utils-9999.ebuild
+++ b/sys-block/lio-utils/lio-utils-9999.ebuild
@@ -81,9 +81,12 @@ src_install(){
ln -s "${sitedir}"/tcm_node.py \
"${ED}"/usr/sbin/tcm_node-${ver}
python_convert_shebangs "${ver}" "${D}${sitedir}"/tcm_node.py
+ ln -s "${sitedir}"/tcm_fabric.py \
+ "${ED}"/usr/sbin/tcm_fabric-${ver}
+ python_convert_shebangs "${ver}" "${D}${sitedir}"/tcm_fabric.py
}
python_execute_function --action-message "Making symlinks to /usr/sbin" symlink_to_sbin
- python_generate_wrapper_scripts "${ED}"/usr/sbin/{lio_dump,lio_node,tcm_node,tcm_dump}
+ python_generate_wrapper_scripts "${ED}"/usr/sbin/{lio_dump,lio_node,tcm_node,tcm_dump,tcm_fabric}
if use snmp; then
cd mib-modules/
@@ -92,5 +95,5 @@ src_install(){
fi
emake DESTDIR="${ED}" conf_install || die "emake conf_install failed"
- #Handle initscripts here
+ newinitd "${FILESDIR}/target.initd" target
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-10 13:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10 13:46 [gentoo-commits] dev/alexxy:master commit in: sys-block/lio-utils/files/, sys-block/lio-utils/ Alexey Shvetsov
-- strict thread matches above, loose matches on Subject: below --
2011-08-12 14:28 Alexey Shvetsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox