debian/0000755000000000000000000000000012124067771007175 5ustar debian/README.debian0000644000000000000000000000073312124067476011303 0ustar lio-utils for Debian ----------------- The Debian lio-utils package provides *) tcm-py and lio-py CLI modules for with /usr/sbin symlinks for tcm_node, tcm_dump, tcm_snap, lio_node, lio_dump *) SCSI and iSCSI net-snmp dlmod objects and txt MIBs *) iscsi-name binary + script setup for /etc/init.d/target The lio-utils .deb package can be built with 'dpkg-buildpackage -rfakeroot' -- Nicholas A. Bellinger (nab) Wed, 2, Dec 2009 22:22:38 -0800. debian/dirs0000644000000000000000000000002412124067476010057 0ustar etc/init.d usr/sbin debian/watch0000644000000000000000000000011412124067476010224 0ustar # currently maintained in git. # upstream plans to do tarball releases soon debian/lio-utils.target.init0000777000000000000000000000000012124067476017005 2../scripts/rc.targetustar debian/copyright0000644000000000000000000000231312124067476011131 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: lio-utils Upstream-Contact: Nicholas A. Bellinger (nab) Source: http://www.risingtidesystems.com/git/?p=lio-utils.git;a=summary Files: * Copyright: 2008,2009 Nicholas A. Bellinger (nab) License: GPL Files: debian/* Copyright: 2011 Ritesh Raj Sarraf License: GPL License: GPL This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2 debian/patches/0000755000000000000000000000000012124067476010626 5ustar debian/patches/series0000644000000000000000000000014612124067476012044 0ustar tcm-file-Set-fd_buffered_io-1-based-upon-active-FILE.patch shell-script-header.patch initscript.patch debian/patches/shell-script-header.patch0000644000000000000000000000124612124067476015511 0ustar Add header to shell scripts for lintian cleanliness Index: lio-utils/conf/lio_start.default =================================================================== --- lio-utils.orig/conf/lio_start.default 2012-05-09 20:17:09.374222159 +0530 +++ lio-utils/conf/lio_start.default 2012-05-15 17:52:42.610940402 +0530 @@ -1 +1,2 @@ +#!/bin/sh # placeholder for lio_start.sh Index: lio-utils/conf/tcm_start.default =================================================================== --- lio-utils.orig/conf/tcm_start.default 2012-05-09 20:17:09.374222159 +0530 +++ lio-utils/conf/tcm_start.default 2012-05-15 17:52:52.882991338 +0530 @@ -1 +1,2 @@ +#!/bin/sh modprobe target_core_mod debian/patches/initscript.patch0000644000000000000000000000154612124067476014045 0ustar initscript fix for compliance with debian policy Index: lio-utils/scripts/rc.target =================================================================== --- lio-utils.orig/scripts/rc.target 2011-11-19 13:13:27.037253451 +0530 +++ lio-utils/scripts/rc.target 2011-12-01 20:56:20.359242413 +0530 @@ -18,11 +18,12 @@ ### BEGIN INIT INFO # Provides: target -# Required-Start: $network $syslog -# Required-Stop: $network $syslog -# Default-Start: 2 3 5 +# Required-Start: $network $syslog $remote_fs +# Required-Stop: $network $syslog $remote_fs +# Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: TCM/ConfigFS and LIO-Target +# Short-Description: Start service at boot time ### END INIT INFO # Source function library. @@ -474,7 +475,7 @@ tcm_status RETVAL=$? ;; - restart|reload) + restart|reload|force-reload) restart 1 ;; *) debian/patches/tcm-file-Set-fd_buffered_io-1-based-upon-active-FILE.patch0000644000000000000000000000477412124067476023213 0ustar From 5d0f4829aa130619e81edad3fe0aaa697fa00be4 Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Thu, 31 Jan 2013 11:54:05 -0800 Subject: [PATCH 1/2] tcm-file: Set fd_buffered_io=1 based upon active FILEIO mode This patch fixes a bug in fd_get_params() where FILEIO buffered enabled mode was not being saved across reboots in /etc/target/tcm_start.sh, causing FILEIO devices created with buffered=true to revert to O_DSYNC mode. Signed-off-by: Nicholas Bellinger Signed-off-by: Ritesh Raj Sarraf --- tcm-py/tcm_fileio.py | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/tcm-py/tcm_fileio.py b/tcm-py/tcm_fileio.py index c130bc6..7429844 100755 --- a/tcm-py/tcm_fileio.py +++ b/tcm-py/tcm_fileio.py @@ -50,15 +50,29 @@ def createvirtdev(path, params): def fd_freevirtdev(): pass +def fd_get_buffered_mode(value): + + off = value.index(' Mode: ') + off += 7 + fd_dev_mode_tmp = value[off:] + fd_dev_mode = fd_dev_mode_tmp.split(' ') + if re.search('Buffered', fd_dev_mode[0]): + fd_dev_mode_str = ",fd_buffered_io=1" + else: + fd_dev_mode_str = "" + + return fd_dev_mode_str + def fd_get_params(path): # Reference by udev_path if available udev_path_file = path + "/udev_path" p = os.open(udev_path_file, 0) value = os.read(p, 1024) if re.search('/dev/', value): - os.close(p) - # Append a FILEIO size of ' 0', as struct block_device sector count is autodetected by TCM - return "fd_dev_name=" + value.rstrip() + ",fd_dev_size=0" + fd_dev_blockdev = 1 + fd_dev_blockdev_str = "fd_dev_name=" + value.rstrip() + ",fd_dev_size=0" + else: + fd_dev_blockdev = 0 os.close(p) @@ -71,6 +85,11 @@ def fd_get_params(path): return p.close() + if fd_dev_blockdev: + fd_dev_mode_str = fd_get_buffered_mode(value) + # Append a FILEIO size of ' 0', as struct block_device sector count is autodetected by TCM + return fd_dev_blockdev_str + fd_dev_mode_str + off = value.index('File: ') off += 6 fd_dev_name_tmp = value[off:] @@ -79,7 +98,10 @@ def fd_get_params(path): off += 7 fd_dev_size_tmp = value[off:] fd_dev_size = fd_dev_size_tmp.split(' ') - params = "fd_dev_name=" + fd_dev_name[0] + ",fd_dev_size=" + fd_dev_size[0] + + fd_dev_mode_str = fd_get_buffered_mode(value) + + params = "fd_dev_name=" + fd_dev_name[0] + ",fd_dev_size=" + fd_dev_size[0] + fd_dev_mode_str # fd_dev_name= and fd_dev_size= parameters for tcm_node --createdev return params -- 1.7.10.4 debian/control0000644000000000000000000000142312124067476010602 0ustar Source: lio-utils Section: python Priority: optional Maintainer: Ritesh Raj Sarraf Build-Depends: debhelper(>= 7.0.50~), python(>= 2.6.6-3~), libsnmp-dev Standards-Version: 3.9.2 Homepage: http://www.risingtidesystems.com/git/?p=lio-utils.git;a=summary Vcs-Git: git://git.debian.org/git/linux-target/lio-utils.git Vcs-Browser: http://git.debian.org/?p=linux-target/lio-utils.git Package: lio-utils Architecture: any Depends: ${python:Depends}, ${misc:Depends}, ${shlibs:Depends} Provides: ${python:Provides} Description: configuration tool for LIO core target lio-utils provide a simple low-level configuration tool set for LIO Linux SCSI Target. This includes the target and its backstores including tcm_loop, and the iSCSI, FCoE and Fibre Channel fabric modules. debian/changelog0000644000000000000000000000171112124067476011051 0ustar lio-utils (3.1+git2.fd0b34fd-2) unstable; urgency=low * [5a3076c] Pick patch from upstream to set buffered io persistent across reboots. Thanks to Nicholas Bellinger -- Ritesh Raj Sarraf Mon, 25 Mar 2013 21:06:14 +0530 lio-utils (3.1+git2.fd0b34fd-1) unstable; urgency=low * [2dcd774] Add README.source * [074e1fc] Imported Upstream version 3.1+git2.fd0b34fd (Closes: #654262, #652052) * [b84f9ac] Fix debian/copyright to comply to format 1.0 * [ff79fe6] Add patch shell-script-header.patch to define header for shell scripts -- Ritesh Raj Sarraf Tue, 15 May 2012 17:54:48 +0530 lio-utils (3.1+git0.91b96103-2) unstable; urgency=low * Upload to unstable -- Ritesh Raj Sarraf Mon, 12 Dec 2011 16:58:13 +0530 lio-utils (3.1+git0.91b96103-1) experimental; urgency=low * Initial release. (Closes: #622382) -- Ritesh Raj Sarraf Fri, 02 Dec 2011 01:01:48 +0530 debian/rules0000755000000000000000000000305112124067476010256 0ustar #!/usr/bin/make -f build_dir = build install_dir = debian/lio-utils %: dh $@ --with python2 override_dh_auto_clean: # manually clean any *.pyc files find . -name "*.pyc" | xargs rm -f find . -name "*.pyo" | xargs rm -f override_dh_auto_build: dh_testdir $(MAKE) DESTDIR=$(install_dir) -C tools cd tcm-py ; python setup.py build --build-base $(build_dir)/tcm-py/ cd lio-py ; python setup.py build --build-base $(build_dir)/lio-py/ override_dh_auto_install: $(MAKE) DESTDIR=$(CURDIR)/$(install_dir) conf_install; \ if [ -d tools ]; then \ mkdir -p $(CURDIR)/$(install_dir)/usr/sbin; \ $(MAKE) DESTDIR=$(CURDIR)/$(install_dir) -C tools install; \ fi if [ -d mib-modules ]; then \ $(MAKE) DESTDIR=$(CURDIR)/$(install_dir) -C mib-modules install; \ fi cd tcm-py ; python setup.py install --prefix=/usr --no-compile --root=$(CURDIR)/$(install_dir) --install-layout=deb cd lio-py ; python setup.py install --prefix=/usr --no-compile --root=$(CURDIR)/$(install_dir) --install-layout=deb override_dh_link: # Hack for now. chmod a+x $(CURDIR)/$(install_dir)/usr/share/pyshared/*.py # Upstream links a bunch of py's to bins. dh_link /usr/share/pyshared/tcm_node.py /usr/sbin/tcm_node dh_link /usr/share/pyshared/tcm_loop.py /usr/sbin/tcm_loop dh_link /usr/share/pyshared/tcm_dump.py /usr/sbin/tcm_dump dh_link /usr/share/pyshared/tcm_fabric.py /usr/sbin/tcm_fabric dh_link /usr/share/pyshared/lio_node.py /usr/sbin/lio_node dh_link /usr/share/pyshared/lio_dump.py /usr/sbin/lio_dump override_dh_installinit: dh_installinit --name target debian/source/0000755000000000000000000000000012124067476010477 5ustar debian/source/format0000644000000000000000000000001412124067476011705 0ustar 3.0 (quilt) debian/README.source0000644000000000000000000000056112124067476011360 0ustar The source archive is typicall extracted from the upstream git repository The command used to prepare the archive is: git archive --format=tar --prefix=lio-utils-3.1+git0.4f87d089/ 4f87d08987ab6332154cc37f81019de15a4af894 | (tar xf - --exclude="debian" ); tar -czvf ../lio-utils-3.1+git0.4f87d089.tar.gz lio-utils-3.1+git0.4f87d089; rm -rf lio-utils-3.1+git0.4f87d089; debian/compat0000644000000000000000000000000212124067476010375 0ustar 7