based on patch from Jeremy Laine,
added the missing compat-* patch, and fixed the patch against current
backport
--- iscsitarget/debian/rules2008-11-25 02:42:03.0 -0800
+++ iscsitarget/debian/rules2009-03-03 18:11:03.0 -0800
@@ -42,6 +42,11 @@
kdist_clean:
dh_clean
$(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd)/kernel clean
+ # Revert patch for kernels 2.6.23
+ if [ -f debian/stamp-patched ]; then \
+ patch -p1 -R patches/compat-2.6.14-2.6.23.patch; \
+ rm -f debian/stamp-patched; \
+ fi
# prep-deb-files rewrites the debian/ files as needed. See RATIONALE for
# details
@@ -54,6 +59,11 @@
dh_testdir
dh_testroot
dh_clean -k
+ # Apply patch for kernels 2.6.23
+ if [ ! -f debian/stamp-patched ] dpkg --compare-versions $(KVERS) lt
2.6.23; then \
+ patch -p1 patches/compat-2.6.14-2.6.23.patch; \
+ touch debian/stamp-patched; \
+ fi
#$(MAKE) -C $(KSRC) KERNEL_SOURCES=$(KSRC) MODVERSIONS=detect
KERNEL=linux-$(KVERS) KDIR=$(KSRC) SUBDIRS=$(shell pwd)/kernel modules
$(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd)/kernel modules
@@ -101,10 +111,12 @@
dh_installdirs -p$(psource) usr/src/modules/$(PACKAGE)/debian
dh_installdirs -p$(psource) usr/src/modules/$(PACKAGE)/include
dh_installdirs -p$(psource) usr/src/modules/$(PACKAGE)/kernel
+ dh_installdirs -p$(psource) usr/src/modules/$(PACKAGE)/patches
# Copy only the driver source to the proper location
cp kernel/* debian/$(psource)/usr/src/modules/$(PACKAGE)/kernel/
cp include/* debian/$(psource)/usr/src/modules/$(PACKAGE)/include/
+ cp patches/* debian/$(psource)/usr/src/modules/$(PACKAGE)/patches/
# Copy the needed debian/ pieces to the proper location
cp debian/*-module-* \
diff -uN iscsitarget/patches/compat-2.6.14-2.6.23.patch
iscsitarget/patches/compat-2.6.14-2.6.23.patch
--- iscsitarget/patches/compat-2.6.14-2.6.23.patch 1969-12-31
16:00:00.0 -0800
+++ iscsitarget/patches/compat-2.6.14-2.6.23.patch 2009-03-03
18:11:03.0 -0800
@@ -0,0 +1,344 @@
+diff -uNr iscsitarget/kernel/block-io.c iscsitarget/kernel/block-io.c
+--- iscsitarget/kernel/block-io.c 2008-11-25 02:42:03.0 -0800
iscsitarget/kernel/block-io.c 2009-03-03 18:01:49.0 -0800
+@@ -29,10 +29,15 @@
+ struct completion tio_complete;
+ };
+
+-static void blockio_bio_endio(struct bio *bio, int error)
++static int
++blockio_bio_endio(struct bio *bio, unsigned int bytes_done, int error)
+ {
+ struct tio_work *tio_work = bio-bi_private;
+
++ /* Ignore partials */
++ if (bio-bi_size)
++ return 1;
++
+ error = test_bit(BIO_UPTODATE, bio-bi_flags) ? error : -EIO;
+
+ if (error)
+@@ -43,6 +48,8 @@
+ complete(tio_work-tio_complete);
+
+ bio_put(bio);
++
++ return 0;
+ }
+
+ /*
+diff -uNr iscsitarget/kernel/config.c iscsitarget/kernel/config.c
+--- iscsitarget/kernel/config.c2008-11-25 02:42:03.0 -0800
iscsitarget/kernel/config.c2009-03-03 18:01:49.0 -0800
+@@ -40,7 +40,7 @@
+ int i;
+ struct proc_dir_entry *ent;
+
+- if (!(proc_iet_dir = proc_mkdir(iet, init_net.proc_net)))
++ if (!(proc_iet_dir = proc_mkdir(net/iet, 0)))
+ goto err;
+
+ proc_iet_dir-owner = THIS_MODULE;
+diff -uNr iscsitarget/kernel/digest.c iscsitarget/kernel/digest.c
+--- iscsitarget/kernel/digest.c2008-11-25 02:42:03.0 -0800
iscsitarget/kernel/digest.c2009-03-03 18:02:00.0 -0800
+@@ -12,8 +12,7 @@
+
+ void digest_alg_available(unsigned int *val)
+ {
+- if (*val DIGEST_CRC32C
+- !crypto_has_alg(crc32c, 0, CRYPTO_ALG_ASYNC)) {
++ if (*val DIGEST_CRC32C !crypto_alg_available(crc32c, 0)) {
+ printk(CRC32C digest algorithm not available in kernel\n);
+ *val |= ~DIGEST_CRC32C;
+ }
+@@ -37,22 +36,15 @@
+ if (!(conn-ddigest_type DIGEST_ALL))
+ conn-ddigest_type = DIGEST_NONE;
+
+- if (conn-hdigest_type DIGEST_CRC32C ||
+- conn-ddigest_type DIGEST_CRC32C) {
+- conn-rx_hash.tfm = crypto_alloc_hash(crc32c, 0,
+-CRYPTO_ALG_ASYNC);
+- conn-rx_hash.flags = 0;
+- if (IS_ERR(conn-rx_hash.tfm)) {
+- conn-rx_hash.tfm = NULL;
++ if (conn-hdigest_type DIGEST_CRC32C || conn-ddigest_type
DIGEST_CRC32C) {
++ conn-rx_digest_tfm = crypto_alloc_tfm(crc32c, 0);
++ if (!conn-rx_digest_tfm) {
+ err = -ENOMEM;
+ goto out;
+ }
+
+- conn-tx_hash.tfm = crypto_alloc_hash(crc32c, 0,
+-