diff options
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | THANKS | 13 | ||||
-rw-r--r-- | debian/README.Debian | 44 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 27 | ||||
-rw-r--r-- | debian/control.modules.in | 20 | ||||
-rw-r--r-- | debian/copyright | 12 | ||||
-rw-r--r-- | debian/dirs | 3 | ||||
-rw-r--r-- | debian/docs | 4 | ||||
-rw-r--r-- | debian/postinst.modules.in | 11 | ||||
-rw-r--r-- | debian/rules | 152 | ||||
-rw-r--r-- | debian/rules.modules | 39 | ||||
-rw-r--r-- | etc/initd/initd.debian | 97 |
14 files changed, 427 insertions, 7 deletions
@@ -81,7 +81,7 @@ kernel config. You also need to enable "CRC32c CRC algorithm" if you use header or data digests. They are the kernel options, CONFIG_CRYPTO and CONFIG_CRYPTO_CRC32C, respectively. -Compilation of the kernel Opne-iSCSI modules requires a path +Compilation of the kernel Open-iSCSI modules requires a path to kernel sources: make KSRC=<kernel-src> @@ -90,6 +90,9 @@ or cross-compilation: make KSRC=<kernel-src> KARCH="ARCH=um" +If you choose to install the Debian packages instead of building from source, +please read the file /usr/share/doc/linux-iscsi/README.debian for information +on how to build kernel modules against your specific kernel. 4. Open-iSCSI daemon ==================== @@ -1,6 +1,7 @@ -contribution: Christoph Hellwig <hch@infradead.org> -contribution: Mike Christie <mikenc@us.ibm.com> -contribution: Ming Zhang <mingz@ele.uri.edu> -testing: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> -testing: Harald Kubota <hkubota@gmx.net> -testing: Pascal Renauld <prenauld@istorageinc.com> +contribution: Christoph Hellwig <hch at infradead.org> +contribution: Mike Christie <mikenc at us.ibm.com> +contribution: Ming Zhang <mingz at ele.uri.edu> +packaging: Chad Tindel <ctindel at gmail.com> +testing: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp> +testing: Harald Kubota <hkubota at gmx.net> +testing: Pascal Renauld <prenauld at istorageinc.com> diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..98ebd23 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,44 @@ +linux-iscsi for Debian +----------------------------------- + +The linux-iscsi package contains the userspace portion the Linux iSCSI project. +It has a dependency on the linux-iscsi-modules package, which needs to be built from the linux-iscsi-modules-source against the specific kernel version running +on your system. + +Building +-------- +Modules cannot be built against the kernel-headers alone. You will need +to extract and configure your kernel tree, then use the make-kpkg command +(from the kernel-package package) to build a new kernel and modules. +See the make-kpkg man page, particularly the modules-image section. The +following example shows how to build the linux-iscsi-modules package; just +substitute the appropriate version strings. Follow these instructions +(as root) in order to build the linux-iscsi-modules package for your kernel: + +dpkg -i linux-iscsi-modules-source_5.0.0.0.3rc6-363_all.deb +cd /usr/src +rm -rf modules/linux-iscsi +tar jxpvf linux-iscsi-modules-source.tar.bz2 +cd linux-2.6.11.11 (or your appropriate version) +make-kpkg --added-modules linux-iscsi modules-image + +By default, make-kpkg will assume /usr/src/linux-iscsi-modules-source.tar.bz2 +has been extracted under /usr/src. However, that also requires building as +root. If you want to do the build as a non-root user, you need to use the +MODULE_LOC environment variable. For example: + +cd ~/builds +export MODULES_LOC=$PWD/modules +tar jxpvf /usr/src/linux-iscsi-modules-source.tar.bz2 +cd ~/builds/linux-2.6.11.11 (or your appropriate version) +make-kpkg --added-modules linux-iscsi modules-image + +Installing +---------- + +Once you have built the linux-iscsi-modules package, you can install the +binaries: + +dpkg -i linux-iscsi_5.0.0.0.3rc6-363_i386.deb linux-iscsi-modules-2.6.11.11_5.0.0.0.3rc6-363+10.00.Custom_i386.deb + + -- Chad Tindel <chad.tindel@hp.com>, Mon, 30 May 2005 15:17:53 -0600 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..f71577e --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +linux-iscsi (5.0.0.0.3rc6-363) unstable; urgency=low + + * Initial Release. + + -- Chad Tindel <chad.tindel@hp.com> Mon, 30 May 2005 15:17:53 -0600 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +4 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..d333569 --- /dev/null +++ b/debian/control @@ -0,0 +1,27 @@ +Source: linux-iscsi +Section: net +Priority: optional +Maintainer: Chad Tindel <chad.tindel@hp.com> +Build-Depends: debhelper (>= 4.0.0), libdb4.3, libdb4.3-dev +Standards-Version: 3.6.1 + +Package: linux-iscsi +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, linux-iscsi-modules +Description: high performance, transport independent implementation of RFC3720. + linux-iscsi is a high performance, transport independent, implementation of + RFC3720. + +#Package: linux-iscsi +#Architecture: all +#Description: Documentation for linux-iscsi +#linux-iscsi is a high performance, transport independent, implementation of +#RFC3720. + +Package: linux-iscsi-modules-source +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, module-assistant, debhelper (>= 4.0.0), bzip2 +Description: Source Code for the Linux iSCSI Kernel Modules + Along with make-kpkg, this package maybe used to build a linux-iscsi-modules + package for a kernel-image package. + diff --git a/debian/control.modules.in b/debian/control.modules.in new file mode 100644 index 0000000..9371b34 --- /dev/null +++ b/debian/control.modules.in @@ -0,0 +1,20 @@ +Source: linux-iscsi-modules +Section: net +Priority: optional +Maintainer: Chad Tindel <chad.tindel@hp.com> +Build-Depends: debhelper (>> 4.1.0), bzip2 +Standards-Version: 3.6.1 + +Package: linux-iscsi-modules-_KVERS_ +Architecture: any +Depends: modutils, linux-iscsi +Provides: linux-iscsi-modules +Description: Linux Kernel Driver Modules for Linux iSCSI (kernel _KVERS_) + This is a Linux driver for iSCSI initiator functionality. + . + This package contains the compiled kernel modules for _KVERS_ + . + If you have compiled your own kernel, you will most likely need to build + your own linux-iscsi-modules. The linux-iscsi-source package has been + provided for use with the Debian kernel-package utility to produce a version + of linux-iscsi-module for your kernel. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..11c0945 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,12 @@ +This package was debianized by Chad Tindel <chad.tindel@hp.com> on +Mon, 30 May 2005 15:17:53 -0600. + +It was downloaded from http://sourceforge.net/projects/linux-iscsi + +Copyright Holder: Dmitry Yusupov <dima@neterion.com> + +License: + +You are free to distribute this software under the terms of the GNU General +Public License. On Debian systems, the complete text of the GNU General Public +License can be found in the file `/usr/share/common-licenses/GPL'. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..c386116 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/sbin +etc/init.d diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..9b70221 --- /dev/null +++ b/debian/docs @@ -0,0 +1,4 @@ +README +COPYING +THANKS +TODO diff --git a/debian/postinst.modules.in b/debian/postinst.modules.in new file mode 100644 index 0000000..70dc20d --- /dev/null +++ b/debian/postinst.modules.in @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "`uname -r`" = "_KVERS_" ]; then + /sbin/depmod -a & +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..f4695c6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,152 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +#Architecture +build: build-arch build-indep + +build-arch: build-arch-stamp +build-arch-stamp: configure-stamp + + # Add here commands to compile the arch part of the package. + $(MAKE) -C usr + + touch build-arch-stamp + +build-indep: build-indep-stamp +build-indep-stamp: configure-stamp + + # Add here commands to compile the indep part of the package. + #$(MAKE) doc + touch build-indep-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP# + + # Add here commands to clean up after the build process. + $(MAKE) -C usr clean + rm -rf modules + + dh_clean + +install: install-indep install-arch +install-indep: + dh_testdir + dh_testroot + dh_clean -k -i + dh_installdirs -i + + # create needed directories + dh_installdirs -i usr/src/modules/linux-iscsi + + mkdir -p modules/linux-iscsi/debian + + # copy the driver source + tar --exclude=debian -c * | (cd modules/linux-iscsi && tar xv) + + # copy all relevant debian/ files + cp debian/{compat,copyright} modules/linux-iscsi/debian + cat debian/changelog | sed -e 's/linux-iscsi/linux-iscsi-modules/' > modules/linux-iscsi/debian/changelog + cp debian/*.modules.in modules/linux-iscsi/debian + install -m755 debian/rules.modules modules/linux-iscsi/debian/rules + + # entar the source + tar jcf debian/linux-iscsi-modules-source/usr/src/linux-iscsi-modules-source.tar.bz2 modules + + # Add here commands to install the indep part of the package into + # debian/<package>-doc. + #INSTALLDOC# + + dh_install -i + +install-arch: + dh_testdir + dh_testroot + dh_clean -k -s + dh_installdirs -s + + # Add here commands to install the arch part of the package into + # debian/linux-iscsi. + install -m 755 usr/iscsiadm $(CURDIR)/debian/linux-iscsi/usr/bin + install -m 755 usr/iscsid $(CURDIR)/debian/linux-iscsi/usr/sbin + install -m 644 etc/iscsid.conf $(CURDIR)/debian/linux-iscsi/etc/iscsid.conf.example + install -m 755 etc/initd/initd.debian $(CURDIR)/debian/linux-iscsi/etc/init.d/iscsid + make clean + + dh_install -s + +# Must not depend on anything. This is to be called by +# binary-arch/binary-indep +# in another 'make' thread. +binary-common: + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +# Build architecture independant packages using the common target. +binary-indep: build-indep install-indep + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +binary-arch: build-arch install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure diff --git a/debian/rules.modules b/debian/rules.modules new file mode 100644 index 0000000..1c4dabd --- /dev/null +++ b/debian/rules.modules @@ -0,0 +1,39 @@ +#!/usr/bin/make -f + +# module-assistant stuff +PACKAGE = linux-iscsi-modules +MA_DIR ?= /usr/share/modass +-include $(MA_DIR)/include/generic.make +-include $(MA_DIR)/include/common-rules.make + +kdist_clean: prep-deb-files + dh_clean + #$(MAKE) clean KERNEL_PATH=$(KSRC) + make clean + +kdist_config: prep-deb-files + +TARGET = $(CURDIR)/debian/linux-iscsi-modules-$(KVERS) +MODULES_TARGET = $(TARGET)/lib/modules/$(KVERS)/kernel/net/iscsi + +binary-modules: kdist_config + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs lib/modules/$(KVERS) + + # build and install the module + patch -d kernel < kernel/backward-compile-2.6.11.patch + make -C kernel KSRC=$(KSRC) + mkdir -p $(MODULES_TARGET) + install -m 755 kernel/iscsi_tcp.ko $(MODULES_TARGET) + install -m 755 kernel/scsi_transport_iscsi.ko $(MODULES_TARGET) + + dh_installdocs + dh_installchangelogs + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol -- -v$(VERSION) + dh_md5sums + dh_builddeb --destdir=$(DEB_DESTDIR) diff --git a/etc/initd/initd.debian b/etc/initd/initd.debian new file mode 100644 index 0000000..d2c49ce --- /dev/null +++ b/etc/initd/initd.debian @@ -0,0 +1,97 @@ +#!/bin/sh +# +# chkconfig: - 39 35 +# description: Starts and stops the iSCSI initiator +# debianized start-stop script + +PID_FILE=/var/run/iscsid.pid +CONFIG_FILE=/etc/iscsid.conf +DAEMON=/usr/sbin/iscsid + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +RETVAL=0 + +iscsid_start() +{ + echo -n "Starting iSCSI initiator service: " + modprobe scsi_transport_iscsi + modprobe iscsi_tcp + start-stop-daemon --start --exec $DAEMON --quiet + RETVAL=$? + if [ $RETVAL == "0" ]; then + echo "succeeded." + else + echo "failed." + fi +} + +iscsid_stop() +{ + echo -n "Stopping iSCSI initiator service: " + start-stop-daemon --stop --quiet --exec $DAEMON --pidfile $PID_FILE + RETVAL=$? + if [ $RETVAL == "0" ]; then + echo "succeeded." + else + echo "failed." + fi + # ugly, but pid file is not removed by iscsid + rm -f $PID_FILE + + echo -n "Removing iSCSI enterprise target modules: " + modprobe -r iscsi_tcp + modprobe -r scsi_transport_iscsi + RETVAL=$? + if [ $RETVAL == "0" ]; then + echo "succeeded." + else + echo "failed." + exit 1 + fi +} + +case "$1" in + start) + iscsid_start + ;; + stop) + iscsid_stop + ;; + restart) + iscsid_stop + sleep 1 + iscsid_start + ;; + status) + PID=`pidof iscsid` + if [ $PID ]; then + echo "iSCSI initiator is running at pid $PID" + else + echo "no iSCSI initiator found!" + exit 1 + fi + ;; + dump) + DUMP=`tempfile -p iscsid` + RETVAL=$? + if [ $RETVAL != "0" ]; then + echo "Failed to create dump file $DUMP" + exit 1 + fi + iscsiadm -m node --record 0a45f8 >$DUMP + RETVAL=$? + if [ $RETVAL != "0" ]; then + echo "Error dumping config from daemon" + rm $DUMP + exit 1 + fi + mv -u $DUMP $CONFIG_FILE + echo "Config dumped to $CONFIG_FILE" + ;; + *) + echo $"Usage: $0 {start|stop|restart|status|dump}" + exit 1 +esac + +exit 0 |