[iscsi-initiator-utils: 4/109] auto-import iscsi-initiator-utils-5.0.0.4_446-0 on branch devel from iscsi-initiator-utils-5.0.0.4_4

Chris Leech cleech at fedoraproject.org
Tue Dec 10 21:19:42 UTC 2013


commit 8f9cfe4197da5db639fda2e1eef7a99f2ca51ec8
Author: mchristi <mchristi at redhat.com>
Date:   Thu Dec 15 07:34:49 2005 +0000

    auto-import iscsi-initiator-utils-5.0.0.4_446-0 on branch devel from iscsi-initiator-utils-5.0.0.4_446-0.src.rpm

 .cvsignore                                   |    2 +-
 iscsi-initiator-utils.spec                   |  118 ++-----
 linux-iscsi-4.0.1.8-redhatify.patch          |   12 -
 linux-iscsi-4.0.1.8-remove_kerneldeps.patch  |  181 ----------
 open-iscsi-5.0.0.4_446-add-iscsi-iname.patch |  470 ++++++++++++++++++++++++++
 open-iscsi-5.0.0.4_446-initscript.patch      |   73 ++++
 open-iscsi-5.0.0.4_446-rm-rdma.patch         |   75 ++++
 sources                                      |    2 +-
 8 files changed, 648 insertions(+), 285 deletions(-)
---
diff --git a/.cvsignore b/.cvsignore
index 39508d9..aca2a19 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +1 @@
-linux-iscsi-user-4.0.1.8.tgz
+open-iscsi-5.0.0.4_446.tar.gz
diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec
index f5dc39f..5f9e35e 100644
--- a/iscsi-initiator-utils.spec
+++ b/iscsi-initiator-utils.spec
@@ -1,19 +1,19 @@
 Summary: iSCSI daemon and utility programs
 Name: iscsi-initiator-utils
-Version: 4.0.1.8
-Release: 0.1
-Source0: http://prdownloads.sourceforge.net/linux-iscsi/linux-iscsi-user-%{version}.tgz
-Patch0: linux-iscsi-4.0.1.8-redhatify.patch
-Patch1: linux-iscsi-4.0.1.8-remove_kerneldeps.patch
+Version: 5.0.0.4_446
+Release: 0
+Source0: http://people.redhat.com/mchristi/iscsi/FC5/open-iscsi/rpm/open-iscsi-%{version}.tar.gz
+Patch0: open-iscsi-5.0.0.4_446-initscript.patch
+Patch1: open-iscsi-5.0.0.4_446-rm-rdma.patch
+Patch2: open-iscsi-5.0.0.4_446-add-iscsi-iname.patch
 Group: System Environment/Daemons
 License: GPL
-URL: http://linux-iscsi.sourceforge.net/
+URL: http://www.open-iscsi.org
 Buildroot: %{_tmppath}/%{name}-root
-BuildRequires: sysfsutils-devel
 Requires: kernel
+BuildRequires: openssl-devel db4-devel
 Prereq: /sbin/chkconfig
 ExcludeArch: s390 s390x
-Obsoletes: iscsi
 
 %description
 The iscsi package provides the server daemon for the iSCSI protocol,
@@ -23,33 +23,29 @@ Protocol networks.
 
 %prep
 %setup -q -n %{name}-%{version} -c
-cd linux-iscsi-%{version}
-%patch0 -p1 -b .redhatify
-%patch1 -p1 -b .remkdep
+cd open-iscsi-%{version}
+%patch0 -p1 -b .initscript
+%patch1 -p1 -b .rm-rdma
+%patch2 -p1 -b .add-iscsi-iname
 
 %build
-cd linux-iscsi-%{version}
-make daemon utils
+cd open-iscsi-%{version}
+make -C usr
+make -C utils
 
 %install
-cd linux-iscsi-%{version}
+cd open-iscsi-%{version}
 
 rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT{/sbin,/dev/iscsi}
-mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/{man1,man5,man8}
+mkdir -p $RPM_BUILD_ROOT/sbin
+mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8
 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
-install -s -m 755 obj/iscsid obj/utils/iscsi-device obj/utils/iscsi-iname obj/utils/iscsi-ls obj/utils/iscsi-id $RPM_BUILD_ROOT/sbin
-# iscsi-mountall is not necessary because we're using _netdev in /etc/fstab
-install -m 755 misc/scripts/iscsi-umountall $RPM_BUILD_ROOT/sbin
-install -m 644 man/iscsi-ls.1 $RPM_BUILD_ROOT/%{_mandir}/man1
-install -m 644 man/iscsid.8 $RPM_BUILD_ROOT/%{_mandir}/man8
-install -m 644 man/iscsi.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5
-install -m 644 man/iscsi.bindings.5 $RPM_BUILD_ROOT/%{_mandir}/man5
-install -m 755 misc/scripts/rc.iscsi $RPM_BUILD_ROOT/etc/rc.d/init.d/iscsi
-install -m 644 misc/iscsi.conf $RPM_BUILD_ROOT/etc
-echo 'GenerateName=yes' > initiatorname.iscsi
-install -m 600 initiatorname.iscsi $RPM_BUILD_ROOT/etc
-rm -f initiatorname.iscsi
+mkdir -p $RPM_BUILD_ROOT/var/db/iscsi/
+install -s -m 755 usr/iscsid usr/iscsiadm utils/iscsi-iname $RPM_BUILD_ROOT/sbin
+install -m 644 doc/iscsiadm.8 $RPM_BUILD_ROOT/%{_mandir}/man8
+install -m 644 doc/iscsid.8 $RPM_BUILD_ROOT/%{_mandir}/man8
+install -m 755 etc/initd/initd.redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/iscsi
+install -m 644 etc/iscsid.conf $RPM_BUILD_ROOT/etc
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -66,70 +62,12 @@ fi
 %files
 %defattr(-,root,root)
 %config /etc/rc.d/init.d/iscsi
-%attr(600,root,root) %config(noreplace) /etc/initiatorname.iscsi
-%attr(600,root,root) %config(noreplace) /etc/iscsi.conf
-%doc linux-iscsi-%{version}/README
+%attr(600,root,root) %config(noreplace) /etc/iscsid.conf
+%doc open-iscsi-%{version}/README
+%dir /var/db/iscsi
 /sbin/*
 %{_mandir}/*/*
 
 %changelog
-* Mon Jul 19 2004 AJ Lewis <alewis at redhat.com> 4.0.1.8-0.1
-- update to 4.0.1.8 upstream for 2.6 kernels
-- add iscsi-id to binaries installed
-
-* Wed Jul 14 2004 AJ Lewis <alewis at redhat.com> 3.6.0.2-0.1
-- update to 3.6.0.2 upstream
-- add iscsi-ls to installed binaries
-- add iscsi-ls.1 manpage to man1
-- remove /dev/iscsi reference (no longer used)
-
-* Fri Feb 13 2004 Elliot Lee <sopwith at redhat.com>
-- rebuilt
-
-* Thu Jun 05 2003 Elliot Lee <sopwith at redhat.com>
-- rebuilt
-
-* Mon Feb 03 2003 Michael K. Johnson <johnsonm at redhat.com> 3.1.0.3-3
-- rebuild, 3.1.0.3-3
-
-* Mon Nov 11 2002 Michael K. Johnson <johnsonm at redhat.com>
-- Fixed typo in initscript to allow to function
-
-* Thu Oct 17 2002 Michael K. Johnson <johnsonm at redhat.com>
-- update to 3.1.0.3 for draft 16 compliance
-- /etc/initiatorname.iscsi should be mode 600
-- C++ all gone, no need for libstdc++ static link
-
-* Wed Aug 14 2002 Bob Matthews <bmatthews at redhat.com>
-- fix perms on /etc/iscsi.conf
-
-* Mon Jul 15 2002 Michael K. Johnson <johnsonm at redhat.com>
-- add status function
-
-* Thu May 02 2002 Michael K. Johnson <johnsonm at redhat.com>
-- hack to link statically against libstdc++ so /sbin does not depend on /usr
-
-* Wed Apr 10 2002 Michael K. Johnson <johnsonm at redhat.com>
-- update to 2.1.0.20
-
-* Fri Oct 26 2001 Than Ngo <than at redhat.com> 2.0.1.8-3
-- cleanup startup script
-- add excludearch s390 s390x
-
-* Tue Aug 28 2001 Michael K. Johnson <johnsonm at redhat.com>
-- clean up shutdown (#52440)
-
-* Mon Aug 13 2001 Michael K. Johnson <johnsonm at redhat.com>
-- update to 2.0.1.8 for draft 6 compliance
-
-* Mon Aug 13 2001 Bob Matthews <bmatthews at redhat.com>
-- fix typo in initscripts (#51585)
-
-* Tue Jul 31 2001 Bill Nottingham <notting at redhat.com>
-- fix up initscript output (#50502)
-
-* Wed Jul 25 2001 Jeremy Katz <katzj at redhat.com>
-- source /etc/init.d/functions in the initscript
-
-* Tue Jul 24 2001 Michael K. Johnson <johnsonm at redhat.com>
+* Wed Dec 14 2005 Mike Christie <mchristi at redhat.com>
 - initial packaging
diff --git a/open-iscsi-5.0.0.4_446-add-iscsi-iname.patch b/open-iscsi-5.0.0.4_446-add-iscsi-iname.patch
new file mode 100644
index 0000000..e2f23c0
--- /dev/null
+++ b/open-iscsi-5.0.0.4_446-add-iscsi-iname.patch
@@ -0,0 +1,470 @@
+diff -Naurp open-iscsi/Makefile open-iscsi.work/Makefile
+--- open-iscsi/Makefile	2005-12-14 20:31:48.000000000 -0600
++++ open-iscsi.work/Makefile	2005-12-14 22:16:50.000000000 -0600
+@@ -5,6 +5,7 @@
+ all:
+ 	make -C usr
+ 	make -C kernel
++	make -C utils
+ 	@echo
+ 	@echo "Compilation complete                Output file"
+ 	@echo "----------------------------------- ----------------"
+@@ -16,6 +17,7 @@ all:
+ 	@echo Read README file for detailed information.
+ 
+ clean:
++	make -C utils clean
+ 	make -C usr clean
+ 	make -C kernel clean
+ 
+diff -Naurp open-iscsi/utils/iscsi-iname.c open-iscsi.work/utils/iscsi-iname.c
+--- open-iscsi/utils/iscsi-iname.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi.work/utils/iscsi-iname.c	2005-12-14 22:16:06.000000000 -0600
+@@ -0,0 +1,140 @@
++/*
++ * iSCSI InitiatorName creation utility
++ * Copyright (C) 2001 Cisco Systems, Inc.
++ * maintained by linux-iscsi-devel at lists.sourceforge.net
++ *
++ * This program 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 program 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.
++ *
++ * See the file COPYING included with this distribution for more details.
++ *
++ * $Id$
++ *
++ * iscsi-iname.c - Compute an iSCSI InitiatorName for this host.
++ * Note that to ensure uniqueness, the system time is
++ * a factor.  This name must be cached and only regenerated
++ * if there is no cached value.
++ */
++
++#include <stdint.h>
++#include <fcntl.h>
++#include <unistd.h>
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <sys/utsname.h>
++#include <sys/time.h>
++
++#include "md5.h"
++
++#define RANDOM_NUM_GENERATOR	"/dev/urandom"
++
++int
++main(int argc, char *argv[])
++{
++	char iname[256];
++	struct timeval time;
++	struct utsname system_info;
++	long hostid;
++	struct MD5Context context;
++	unsigned char digest[16];
++	unsigned char *bytes = digest;
++	unsigned char entropy[16];
++	int e;
++	int fd;
++	char *prefix;
++
++	/* initialize */
++	memset(iname, 0, sizeof (iname));
++	memset(digest, 0, sizeof (digest));
++	memset(&context, 0, sizeof (context));
++	MD5Init(&context);
++
++	/* take a prefix if given, otherwise use a default. */
++	if (argc > 1 && argv[1]) {
++		prefix = argv[1];
++		if (( strcmp(prefix, "-h") == 0 ) ||
++		    ( strcmp(prefix, "--help") == 0 )) {
++			printf("\nDisplays the iSCSI initiator name\n");
++			exit(0);
++		} else if ( strcmp(prefix, "-p") == 0 ) {
++			prefix = argv[2];
++		} else {
++			printf("\nUsage: iscsi-iname [-h | --help | "
++			       "-p <prefix>]\n");
++			exit(0);
++		}
++	} else {
++		prefix = "iqn.2005-03.com.max:01";
++	}
++
++	/* try to feed some entropy from the pool to MD5 in order to get
++	 * uniqueness properties
++	 */
++
++	if ((fd = open(RANDOM_NUM_GENERATOR, O_RDONLY))) {
++		e = read(fd, &entropy, 16);
++		if (e >= 1)
++			MD5Update(&context, (md5byte *)entropy, e);
++		close(fd);
++	}
++
++	/* time the name is created is a factor in order to get
++	 * uniqueness properties
++	 */
++	if (gettimeofday(&time, NULL) < 0) {
++		perror("error: gettimeofday failed");
++		return 1;
++	}
++	MD5Update(&context, (md5byte *) & time.tv_sec, sizeof (time.tv_sec));
++	MD5Update(&context, (md5byte *) & time.tv_usec, sizeof (time.tv_usec));
++
++	/* hostid */
++	hostid = gethostid();
++	MD5Update(&context, (md5byte *) & hostid, sizeof (hostid));
++
++	/* get the hostname and system name */
++	if (uname(&system_info) < 0) {
++		perror("error: uname failed");
++		return 1;
++	}
++	MD5Update(&context, (md5byte *) system_info.sysname,
++		  sizeof (system_info.sysname));
++	MD5Update(&context, (md5byte *) system_info.nodename,
++		  sizeof (system_info.nodename));
++	MD5Update(&context, (md5byte *) system_info.release,
++		  sizeof (system_info.release));
++	MD5Update(&context, (md5byte *) system_info.version,
++		  sizeof (system_info.version));
++	MD5Update(&context, (md5byte *) system_info.machine,
++		  sizeof (system_info.machine));
++
++	/* compute the md5 hash of all the bits we just collected */
++	MD5Final(digest, &context);
++
++	/* vary which md5 bytes we pick (though we probably don't need to do
++	 * this, since hopefully MD5 produces results such that each byte is as
++	 * good as any other).
++	 */
++
++	if ((fd = open(RANDOM_NUM_GENERATOR, O_RDONLY))) {
++		if (read(fd, entropy, 1) == 1)
++			bytes = &digest[(entropy[0] % (sizeof(digest) - 6))];
++		close(fd);
++	}
++
++	/* print the prefix followed by 6 bytes of the MD5 hash */
++	sprintf(iname, "%s.%x%x%x%x%x%x", prefix,
++		bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5]);
++
++	iname[sizeof (iname) - 1] = '\0';
++	printf("%s\n", iname);
++	return 0;
++}
+diff -Naurp open-iscsi/utils/Makefile open-iscsi.work/utils/Makefile
+--- open-iscsi/utils/Makefile	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi.work/utils/Makefile	2005-12-14 21:44:39.000000000 -0600
+@@ -0,0 +1,12 @@
++# This Makefile will work only with GNU make.
++
++CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g
++PROGRAMS = iscsi-iname
++
++all: $(PROGRAMS)
++
++iscsi-iname: md5.o iscsi-iname.o
++	$(CC) $^ $(DBM_LIB) -o $@
++
++clean:
++	rm -f *.o $(PROGRAMS)
+diff -Naurp open-iscsi/utils/md5.c open-iscsi.work/utils/md5.c
+--- open-iscsi/utils/md5.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi.work/utils/md5.c	2005-12-14 22:15:08.000000000 -0600
+@@ -0,0 +1,242 @@
++/*
++ * This code implements the MD5 message-digest algorithm.
++ * The algorithm is due to Ron Rivest.  This code was
++ * written by Colin Plumb in 1993, no copyright is claimed.
++ * This code is in the public domain; do with it what you wish.
++ *
++ * Equivalent code is available from RSA Data Security, Inc.
++ * This code has been tested against that, and is equivalent,
++ * except that you don't need to include two pages of legalese
++ * with every copy.
++ *
++ * To compute the message digest of a chunk of bytes, declare an
++ * MD5Context structure, pass it to MD5Init, call MD5Update as
++ * needed on buffers full of bytes, and then call MD5Final, which
++ * will fill a supplied 16-byte array with the digest.
++ *
++ * Changed so as no longer to depend on Colin Plumb's `usual.h' header
++ * definitions; now uses stuff from dpkg's config.h.
++ *  - Ian Jackson <ijackson at nyx.cs.du.edu>.
++ * Still in the public domain.
++ */
++
++#include <string.h>
++
++#include "md5.h"
++
++#if (__BYTE_ORDER == __BIG_ENDIAN)
++/*
++ * we can compile this away for little endian since
++ * it does not do anything on those archs
++ */
++void
++byteSwap(uint32_t * buf, unsigned words)
++{
++	md5byte *p = (md5byte *) buf;
++
++	do {
++		*buf++ = (uint32_t) ((unsigned) p[3] << 8 | p[2]) << 16 |
++		    ((unsigned) p[1] << 8 | p[0]);
++		p += 4;
++	} while (--words);
++}
++#else
++#define byteSwap(buf,words)
++#endif
++
++/*
++ * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
++ * initialization constants.
++ */
++void
++MD5Init(struct MD5Context *ctx)
++{
++	ctx->buf[0] = 0x67452301;
++	ctx->buf[1] = 0xefcdab89;
++	ctx->buf[2] = 0x98badcfe;
++	ctx->buf[3] = 0x10325476;
++
++	ctx->bytes[0] = 0;
++	ctx->bytes[1] = 0;
++}
++
++/*
++ * Update context to reflect the concatenation of another buffer full
++ * of bytes.
++ */
++void
++MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len)
++{
++	uint32_t t;
++
++	/* Update byte count */
++
++	t = ctx->bytes[0];
++	if ((ctx->bytes[0] = t + len) < t)
++		ctx->bytes[1]++;	/* Carry from low to high */
++
++	t = 64 - (t & 0x3f);	/* Space available in ctx->in (at least 1) */
++	if (t > len) {
++		memcpy((md5byte *) ctx->in + 64 - t, buf, len);
++		return;
++	}
++	/* First chunk is an odd size */
++	memcpy((md5byte *) ctx->in + 64 - t, buf, t);
++	byteSwap(ctx->in, 16);
++	MD5Transform(ctx->buf, ctx->in);
++	buf += t;
++	len -= t;
++
++	/* Process data in 64-byte chunks */
++	while (len >= 64) {
++		memcpy(ctx->in, buf, 64);
++		byteSwap(ctx->in, 16);
++		MD5Transform(ctx->buf, ctx->in);
++		buf += 64;
++		len -= 64;
++	}
++
++	/* Handle any remaining bytes of data. */
++	memcpy(ctx->in, buf, len);
++}
++
++/*
++ * Final wrapup - pad to 64-byte boundary with the bit pattern 
++ * 1 0* (64-bit count of bits processed, MSB-first)
++ */
++void
++MD5Final(md5byte digest[16], struct MD5Context *ctx)
++{
++	int count = ctx->bytes[0] & 0x3f;	/* Number of bytes in ctx->in */
++	md5byte *p = (md5byte *) ctx->in + count;
++
++	/* Set the first char of padding to 0x80.  There is always room. */
++	*p++ = 0x80;
++
++	/* Bytes of padding needed to make 56 bytes (-8..55) */
++	count = 56 - 1 - count;
++
++	if (count < 0) {	/* Padding forces an extra block */
++		memset(p, 0, count + 8);
++		byteSwap(ctx->in, 16);
++		MD5Transform(ctx->buf, ctx->in);
++		p = (md5byte *) ctx->in;
++		count = 56;
++	}
++	memset(p, 0, count);
++	byteSwap(ctx->in, 14);
++
++	/* Append length in bits and transform */
++	ctx->in[14] = ctx->bytes[0] << 3;
++	ctx->in[15] = ctx->bytes[1] << 3 | ctx->bytes[0] >> 29;
++	MD5Transform(ctx->buf, ctx->in);
++
++	byteSwap(ctx->buf, 4);
++	memcpy(digest, ctx->buf, 16);
++	memset(ctx, 0, sizeof (ctx));	/* In case it's sensitive */
++}
++
++#ifndef ASM_MD5
++
++/* The four core functions - F1 is optimized somewhat */
++
++/* #define F1(x, y, z) (x & y | ~x & z) */
++#define F1(x, y, z) (z ^ (x & (y ^ z)))
++#define F2(x, y, z) F1(z, x, y)
++#define F3(x, y, z) (x ^ y ^ z)
++#define F4(x, y, z) (y ^ (x | ~z))
++
++/* This is the central step in the MD5 algorithm. */
++#define MD5STEP(f,w,x,y,z,in,s) \
++	 (w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
++
++/*
++ * The core of the MD5 algorithm, this alters an existing MD5 hash to
++ * reflect the addition of 16 longwords of new data.  MD5Update blocks
++ * the data and converts bytes into longwords for this routine.
++ */
++void
++MD5Transform(uint32_t buf[4], uint32_t const in[16])
++{
++	register uint32_t a, b, c, d;
++
++	a = buf[0];
++	b = buf[1];
++	c = buf[2];
++	d = buf[3];
++
++	MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
++	MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
++	MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
++	MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
++	MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
++	MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
++	MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
++	MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
++	MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
++	MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
++	MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
++	MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
++	MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
++	MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
++	MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
++	MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
++
++	MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
++	MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
++	MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
++	MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
++	MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
++	MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
++	MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
++	MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
++	MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
++	MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
++	MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
++	MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
++	MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
++	MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
++	MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
++	MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
++
++	MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
++	MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
++	MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
++	MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
++	MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
++	MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
++	MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
++	MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
++	MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
++	MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
++	MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
++	MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
++	MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
++	MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
++	MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
++	MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
++
++	MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
++	MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
++	MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
++	MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
++	MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
++	MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
++	MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
++	MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
++	MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
++	MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
++	MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
++	MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
++	MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
++	MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
++	MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
++	MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
++
++	buf[0] += a;
++	buf[1] += b;
++	buf[2] += c;
++	buf[3] += d;
++}
++
++#endif
+diff -Naurp open-iscsi/utils/md5.h open-iscsi.work/utils/md5.h
+--- open-iscsi/utils/md5.h	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi.work/utils/md5.h	2005-12-14 22:14:53.000000000 -0600
+@@ -0,0 +1,41 @@
++/*
++ * This is the header file for the MD5 message-digest algorithm.
++ * The algorithm is due to Ron Rivest.  This code was
++ * written by Colin Plumb in 1993, no copyright is claimed.
++ * This code is in the public domain; do with it what you wish.
++ *
++ * Equivalent code is available from RSA Data Security, Inc.
++ * This code has been tested against that, and is equivalent,
++ * except that you don't need to include two pages of legalese
++ * with every copy.
++ *
++ * To compute the message digest of a chunk of bytes, declare an
++ * MD5Context structure, pass it to MD5Init, call MD5Update as
++ * needed on buffers full of bytes, and then call MD5Final, which
++ * will fill a supplied 16-byte array with the digest.
++ *
++ * Changed so as no longer to depend on Colin Plumb's `usual.h'
++ * header definitions; now uses stuff from dpkg's config.h
++ *  - Ian Jackson <ijackson at nyx.cs.du.edu>.
++ * Still in the public domain.
++ */
++
++#ifndef MD5_H
++#define MD5_H
++
++#include <stdint.h>
++
++#define md5byte unsigned char
++
++struct MD5Context {
++	uint32_t buf[4];
++	uint32_t bytes[2];
++	uint32_t in[16];
++};
++
++void MD5Init(struct MD5Context *context);
++void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len);
++void MD5Final(unsigned char digest[16], struct MD5Context *context);
++void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
++
++#endif				/* !MD5_H */
diff --git a/open-iscsi-5.0.0.4_446-initscript.patch b/open-iscsi-5.0.0.4_446-initscript.patch
new file mode 100644
index 0000000..5909c62
--- /dev/null
+++ b/open-iscsi-5.0.0.4_446-initscript.patch
@@ -0,0 +1,73 @@
+diff -aurp open-iscsi/etc/initd/initd.redhat open-iscsi.work/etc/initd/initd.redhat
+--- open-iscsi/etc/initd/initd.redhat	2005-12-15 00:42:56.000000000 -0600
++++ open-iscsi.work/etc/initd/initd.redhat	2005-12-15 00:40:51.000000000 -0600
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ #
+-# chkconfig: - 39 35
++# chkconfig: - 13 89
+ # description: Starts and stops the iSCSI initiator
+ #
+ # pidfile: /var/run/iscsid.pid
+@@ -35,7 +35,7 @@ start_iscsid()
+     TARGETS=`$ISCSIADM -m node | sed 's@\[\(.*\)\] .*@\1 at g'`
+     for rec in $TARGETS
+     do
+-	STARTUP=`$ISCSIADM -m node -r $rec | grep "node.conn\[0\].startup" | cut -d' ' -f3`
++	STARTUP=`$ISCSIADM -m node -r $rec | grep "node.startup" | cut -d' ' -f3`
+ 	if [ $STARTUP = "automatic" ]
+ 	then
+         	$ISCSIADM -m node -r $rec -l
+@@ -62,6 +62,40 @@ stop_iscsid()
+ start()
+ {
+     RETVAL=0
++
++    # see if we need to generate a unique iSCSI InitiatorName
++    # this should only happen if the
++    if [ ! -f /etc/initiatorname.iscsi ] ; then
++        if [ ! -x /sbin/iscsi-iname ] ; then
++            echo "Error: /sbin/iscsi-iname does not exist, driver was not successfully installed"
++            exit 1;
++        fi
++        # Generate a unique InitiatorName and save it
++        INAME=`/sbin/iscsi-iname`
++        if [ "$INAME" != "" ] ; then
++           echo "## DO NOT EDIT OR REMOVE THIS FILE!" > /etc/initiatorname.iscsi
++           echo "## If you remove this file, the iSCSI daemon will not start." >> /etc/initiatorname.iscsi
++           echo "## If you change the InitiatorName, existing access control lists" >> /etc/initiatorname.iscsi
++           echo "## may reject this initiator.  The InitiatorName must be unique">> /etc/initiatorname.iscsi
++           echo "## for each iSCSI initiator.  Do NOT duplicate iSCSI InitiatorNames." >> /etc/initiatorname.iscsi
++           printf "InitiatorName=$INAME\n"  >> /etc/initiatorname.iscsi
++           chmod 600 /etc/initiatorname.iscsi
++        else
++           echo "Error: failed to generate an iSCSI InitiatorName, driver cannot start."
++           echo
++           exit 1;
++        fi
++    fi
++
++    # make sure there is a valid InitiatorName for the driver
++    if ! grep -q "^InitiatorName=[^ \t\n]" /etc/initiatorname.iscsi ; then
++        echo
++        echo "Error: /etc/initiatorname.iscsi does not contain a valid InitiatorName."
++        echo "The iSCSI driver has not been correctly installed and cannot start."
++        echo
++        exit 1
++    fi
++
+     echo -n "Starting iSCSI initiator service: "
+     PID=`pidofproc $ISCSID`
+     if [ -z $PID ]
+diff -aurp open-iscsi/etc/iscsid.conf open-iscsi.work/etc/iscsid.conf
+--- open-iscsi/etc/iscsid.conf	2005-12-14 20:31:48.000000000 -0600
++++ open-iscsi.work/etc/iscsid.conf	2005-12-15 00:43:20.000000000 -0600
+@@ -3,7 +3,7 @@
+ # Could be located at /etc/iscsid.conf or ~/.iscsid.conf
+ #
+ node.active_cnx = 1
+-node.startup = manual
++node.startup = automatic
+ #node.session.auth.username = dima
+ #node.session.auth.password = aloha
+ node.session.timeo.replacement_timeout = 0
diff --git a/open-iscsi-5.0.0.4_446-rm-rdma.patch b/open-iscsi-5.0.0.4_446-rm-rdma.patch
new file mode 100644
index 0000000..331fcff
--- /dev/null
+++ b/open-iscsi-5.0.0.4_446-rm-rdma.patch
@@ -0,0 +1,75 @@
+diff -aurp open-iscsi/include/iscsi_if.h open-iscsi.work/include/iscsi_if.h
+--- open-iscsi/include/iscsi_if.h	2005-12-14 20:31:33.000000000 -0600
++++ open-iscsi.work/include/iscsi_if.h	2005-12-15 01:21:31.000000000 -0600
+@@ -160,9 +160,8 @@ enum iscsi_param {
+ 	ISCSI_PARAM_ERL			= 11,
+ 	ISCSI_PARAM_IFMARKER_EN		= 12,
+ 	ISCSI_PARAM_OFMARKER_EN		= 13,
+-	ISCSI_PARAM_RDMAEXTENSIONS      = 14,
+ };
+-#define ISCSI_PARAM_MAX			15
++#define ISCSI_PARAM_MAX			14
+ 
+ typedef uint64_t iscsi_sessionh_t;	/* iSCSI Data-Path session handle */
+ typedef uint64_t iscsi_connh_t;		/* iSCSI Data-Path connection handle */
+diff -aurp open-iscsi/usr/initiator.c open-iscsi.work/usr/initiator.c
+--- open-iscsi/usr/initiator.c	2005-12-15 01:22:00.000000000 -0600
++++ open-iscsi.work/usr/initiator.c	2005-12-14 22:27:47.000000000 -0600
+@@ -437,9 +437,7 @@ __session_conn_create(iscsi_session_t *s
+ 			  conn_rec->address, host);
+ 	}
+ 
+-	/* Set the address family according to the value 
+-	   that was received from a specific provider */
+-	conn->saddr.ss_family = session->provider->af;
++	conn->saddr.ss_family = AF_INET;
+ 
+ 	conn->state = STATE_FREE;
+ 	conn->session = session;
+@@ -856,10 +854,6 @@ __session_conn_recv_pdu(queue_item_t *it
+ 				.param = ISCSI_PARAM_OFMARKER_EN,
+ 				.value = &zero,/* FIXME: session->ofmarker_en */
+ 				.conn_only = 0,
+-				}, {
+-				.param = ISCSI_PARAM_RDMAEXTENSIONS,
+-				.value = &session->rdma_ext,
+-				.conn_only = 0,
+ 				}
+ 
+ 				/*
+diff -aurp open-iscsi/usr/ioctl.c open-iscsi.work/usr/ioctl.c
+--- open-iscsi/usr/ioctl.c	2005-12-15 01:22:00.000000000 -0600
++++ open-iscsi.work/usr/ioctl.c	2005-12-14 22:27:46.000000000 -0600
+@@ -404,8 +404,6 @@ ktrans_list(void)
+ 			strncpy(provider[i].name, ev.r.t_list.elements[i].name,
+ 				ISCSI_TRANSPORT_NAME_MAXLEN);
+ 			provider[i].caps = ev.r.t_list.elements[i].caps;
+-			provider[i].af = ev.r.t_list.elements[i].af;			
+-			provider[i].rdma = ev.r.t_list.elements[i].rdma;
+ 		}
+ 	}
+ 	return 0;
+diff -aurp open-iscsi/usr/netlink.c open-iscsi.work/usr/netlink.c
+--- open-iscsi/usr/netlink.c	2005-12-15 01:22:00.000000000 -0600
++++ open-iscsi.work/usr/netlink.c	2005-12-14 22:27:48.000000000 -0600
+@@ -684,20 +684,6 @@ ktrans_list(void)
+ 					  "0x%x");
+ 		if (err)
+ 			break;
+-
+-		sprintf(filename, ISCSI_TRANSPORT_DIR"/%s/af",
+-			provider[i].name);
+-		err = read_transport_file(filename, &provider[i].af,
+-					  "%u");
+-		if (err)
+-			break;
+-
+-		sprintf(filename, ISCSI_TRANSPORT_DIR"/%s/rdma",
+-			provider[i].name);
+-		err = read_transport_file(filename, &provider[i].rdma,
+-					  "%u");
+-		if (err)
+-			break;
+ 	}
+ 
+ 	for (i++; i < n; i++)
diff --git a/sources b/sources
index 321baca..6872bdb 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-f1f92c4a040644106f7f0051f78c1f9d  linux-iscsi-user-4.0.1.8.tgz
+5e047486110c4e5c230b6c3f259d3f1b  open-iscsi-5.0.0.4_446.tar.gz


More information about the scm-commits mailing list