From b1f7b5ac418e982180412cf4ffd1c2c7daee5b4b Mon Sep 17 00:00:00 2001 From: Frans Meulenbroeks Date: Wed, 1 Sep 2010 20:57:57 +0200 Subject: iscsi-target: moved to 1.4.20.2 also renamed the files dir to the more appropriate iscsi-target added a DEFAULT_PREFERENCE = "-1" for beagleboard as angstrom and minimal use a modified 2.6.32 kernel which breaks this recipe Signed-off-by: Frans Meulenbroeks --- recipes/iscsi-target/files/2.6.29.patch | 72 --------------- recipes/iscsi-target/files/2.6.31.patch | 16 ---- recipes/iscsi-target/files/2.6.32.patch | 107 ----------------------- recipes/iscsi-target/files/ietd.conf | 17 ---- recipes/iscsi-target/files/init | 36 -------- recipes/iscsi-target/files/libs.patch | 11 --- recipes/iscsi-target/iscsi-target/2.6.29.patch | 72 +++++++++++++++ recipes/iscsi-target/iscsi-target/2.6.31.patch | 16 ++++ recipes/iscsi-target/iscsi-target/2.6.32.patch | 107 +++++++++++++++++++++++ recipes/iscsi-target/iscsi-target/Makefile.patch | 26 ++++++ recipes/iscsi-target/iscsi-target/ietd.conf | 17 ++++ recipes/iscsi-target/iscsi-target/init | 36 ++++++++ recipes/iscsi-target/iscsi-target/libs.patch | 11 +++ recipes/iscsi-target/iscsi-target_1.4.20.1.bb | 47 ---------- recipes/iscsi-target/iscsi-target_1.4.20.2.bb | 56 ++++++++++++ 15 files changed, 341 insertions(+), 306 deletions(-) delete mode 100644 recipes/iscsi-target/files/2.6.29.patch delete mode 100644 recipes/iscsi-target/files/2.6.31.patch delete mode 100644 recipes/iscsi-target/files/2.6.32.patch delete mode 100644 recipes/iscsi-target/files/ietd.conf delete mode 100644 recipes/iscsi-target/files/init delete mode 100644 recipes/iscsi-target/files/libs.patch create mode 100644 recipes/iscsi-target/iscsi-target/2.6.29.patch create mode 100644 recipes/iscsi-target/iscsi-target/2.6.31.patch create mode 100644 recipes/iscsi-target/iscsi-target/2.6.32.patch create mode 100644 recipes/iscsi-target/iscsi-target/Makefile.patch create mode 100644 recipes/iscsi-target/iscsi-target/ietd.conf create mode 100644 recipes/iscsi-target/iscsi-target/init create mode 100644 recipes/iscsi-target/iscsi-target/libs.patch delete mode 100644 recipes/iscsi-target/iscsi-target_1.4.20.1.bb create mode 100644 recipes/iscsi-target/iscsi-target_1.4.20.2.bb diff --git a/recipes/iscsi-target/files/2.6.29.patch b/recipes/iscsi-target/files/2.6.29.patch deleted file mode 100644 index 24c1afbdd1..0000000000 --- a/recipes/iscsi-target/files/2.6.29.patch +++ /dev/null @@ -1,72 +0,0 @@ -Index: iscsitarget-0.4.17/kernel/block-io.c -=================================================================== ---- iscsitarget-0.4.17/kernel/block-io.c (revision 198) -+++ iscsitarget-0.4.17/kernel/block-io.c (working copy) -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - #include "iscsi.h" - #include "iscsi_dbg.h" -@@ -154,14 +155,22 @@ - { - struct blockio_data *bio_data = volume->private; - struct block_device *bdev; -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) - int flags = LUReadonly(volume) ? MS_RDONLY : 0; -+#else -+ fmode_t flags = LUReadonly(volume) ? FMODE_READ : (FMODE_READ | FMODE_WRITE); -+#endif - int err = 0; - - bio_data->path = kstrdup(path, GFP_KERNEL); - if (!bio_data->path) - return -ENOMEM; - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) - bdev = open_bdev_excl(path, flags, THIS_MODULE); -+#else -+ bdev = open_bdev_exclusive(path, flags, THIS_MODULE); -+#endif - if (IS_ERR(bdev)) { - err = PTR_ERR(bdev); - eprintk("Can't open device %s, error %d\n", path, err); -@@ -324,8 +333,17 @@ - { - struct blockio_data *bio_data = volume->private; - -- if (bio_data->bdev) -+ if (bio_data->bdev) { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) - close_bdev_excl(bio_data->bdev); -+#else -+ if (LUReadonly(volume)) { -+ close_bdev_exclusive(bio_data->bdev, FMODE_READ); -+ } else { -+ close_bdev_exclusive(bio_data->bdev, FMODE_READ|FMODE_WRITE); -+ } -+#endif -+ } - kfree(bio_data->path); - - kfree(volume->private); -Index: iscsitarget-0.4.17/kernel/conn.c -=================================================================== ---- iscsitarget-0.4.17/kernel/conn.c (revision 198) -+++ iscsitarget-0.4.17/kernel/conn.c (working copy) -@@ -46,9 +46,13 @@ - "%u.%u.%u.%u", NIPQUAD(inet_sk(sk)->daddr)); - break; - case AF_INET6: -+#ifdef NIP6 - snprintf(buf, sizeof(buf), - "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]", - NIP6(inet6_sk(sk)->daddr)); -+#else -+ snprintf(buf, sizeof(buf), "[%p6]", &inet6_sk(sk)->daddr); -+#endif - break; - default: - break; diff --git a/recipes/iscsi-target/files/2.6.31.patch b/recipes/iscsi-target/files/2.6.31.patch deleted file mode 100644 index 74c91f5d4c..0000000000 --- a/recipes/iscsi-target/files/2.6.31.patch +++ /dev/null @@ -1,16 +0,0 @@ -Index: iscsitarget-1.4.19/patches/compat-2.6.31.patch -=================================================================== ---- /dev/null -+++ iscsitarget-1.4.19/patches/compat-2.6.31.patch -@@ -0,0 +1,11 @@ -+--- sync/kernel/file-io.c 2009-12-10 17:43:36.000000000 -0500 -++++ trunk/kernel/file-io.c 2008-12-04 17:35:21.000000000 -0500 -+@@ -88,7 +88,7 @@ -+ count = lu->blk_cnt << lu->blk_shift; -+ } -+ -+- res = filemap_write_and_wait_range(mapping, ppos, ppos + count - 1); -++ res = sync_page_range(inode, mapping, ppos, count); -+ if (res) { -+ eprintk("I/O error: syncing pages failed: %d\n", res); -+ return -EIO; diff --git a/recipes/iscsi-target/files/2.6.32.patch b/recipes/iscsi-target/files/2.6.32.patch deleted file mode 100644 index bda0d20470..0000000000 --- a/recipes/iscsi-target/files/2.6.32.patch +++ /dev/null @@ -1,107 +0,0 @@ -Index: x/kernel/file-io.c -=================================================================== ---- x/kernel/file-io.c (revision 276) -+++ x/kernel/file-io.c (working copy) -@@ -88,7 +88,7 @@ - count = lu->blk_cnt << lu->blk_shift; - } - -- res = sync_page_range(inode, mapping, ppos, count); -+ res = filemap_write_and_wait_range(mapping, ppos, ppos + count - 1); - if (res) { - eprintk("I/O error: syncing pages failed: %d\n", res); - return -EIO; -Index: x/dkms.conf -=================================================================== ---- x/dkms.conf (revision 276) -+++ x/dkms.conf (working copy) -@@ -20,33 +20,36 @@ - # Patches newest - oldest, distro spec at bottom - # - --PATCH[0]="compat-2.6.29.patch" --PATCH_MATCH[0]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29)" -+PATCH[0]="compat-2.6.31.patch" -+PATCH_MATCH[0]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)" - --PATCH[1]="compat-2.6.28.patch" --PATCH_MATCH[1]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28)" -+PATCH[1]="compat-2.6.29.patch" -+PATCH_MATCH[1]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29)" - --PATCH[2]="compat-2.6.25-2.6.27.patch" --PATCH_MATCH[2]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27)" -+PATCH[2]="compat-2.6.28.patch" -+PATCH_MATCH[2]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28)" - --PATCH[3]="compat-2.6.24.patch" --PATCH_MATCH[3]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24)" -+PATCH[3]="compat-2.6.25-2.6.27.patch" -+PATCH_MATCH[3]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27)" - --PATCH[4]="compat-2.6.23.patch" --PATCH_MATCH[4]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23)" -+PATCH[4]="compat-2.6.24.patch" -+PATCH_MATCH[4]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24)" - --PATCH[5]="compat-2.6.22.patch" --PATCH_MATCH[5]="2\.6\.(9|14|15|16|17|18|19|20|21|22)" -+PATCH[5]="compat-2.6.23.patch" -+PATCH_MATCH[5]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23)" - --PATCH[6]="compat-2.6.19-2.6.21.patch" --PATCH_MATCH[6]="2\.6\.(9|14|15|16|17|18|19|20|21)" -+PATCH[6]="compat-2.6.22.patch" -+PATCH_MATCH[6]="2\.6\.(9|14|15|16|17|18|19|20|21|22)" - --PATCH[7]="compat-2.6.14-2.6.18.patch" --PATCH_MATCH[7]="2\.6\.(9|14|15|16|17|18)" -+PATCH[7]="compat-2.6.19-2.6.21.patch" -+PATCH_MATCH[7]="2\.6\.(9|14|15|16|17|18|19|20|21)" - --PATCH[8]="compat-sles10sp2.patch" --PATCH_MATCH[8]="2\.6\.16\.60-.*" -+PATCH[8]="compat-2.6.14-2.6.18.patch" -+PATCH_MATCH[8]="2\.6\.(9|14|15|16|17|18)" - --PATCH[9]="compat-rhel4.patch" --PATCH_MATCH[9]="2\.6\.9-.*\.(el|plus\.c4)" -+PATCH[9]="compat-sles10sp2.patch" -+PATCH_MATCH[9]="2\.6\.16\.60-.*" - -+PATCH[10]="compat-rhel4.patch" -+PATCH_MATCH[10]="2\.6\.9-.*\.(el|plus\.c4)" -+ -Index: x/patches/compat-2.6.31.patch -=================================================================== ---- x/patches/compat-2.6.31.patch (revision 0) -+++ x/patches/compat-2.6.31.patch (revision 0) -@@ -0,0 +1,11 @@ -+--- sync/kernel/file-io.c 2009-12-10 17:43:36.000000000 -0500 -++++ trunk/kernel/file-io.c 2008-12-04 17:35:21.000000000 -0500 -+@@ -88,7 +88,7 @@ -+ count = lu->blk_cnt << lu->blk_shift; -+ } -+ -+- res = filemap_write_and_wait_range(mapping, ppos, ppos + count - 1); -++ res = sync_page_range(inode, mapping, ppos, count); -+ if (res) { -+ eprintk("I/O error: syncing pages failed: %d\n", res); -+ return -EIO; -Index: x/Makefile -=================================================================== ---- x/Makefile (revision 276) -+++ x/Makefile (working copy) -@@ -51,6 +51,11 @@ - # base first the earlier patch sets will not need to be modified. - # - -+# Compatibility patch for kernels <= 2.6.31 -+ifeq ($(call kver_le,2,6,31),1) -+ PATCHES := $(PATCHES) compat-2.6.31.patch -+endif -+ - # Compatibility patch for kernels <= 2.6.29 - ifeq ($(call kver_le,2,6,29),1) - PATCHES := $(PATCHES) compat-2.6.29.patch - diff --git a/recipes/iscsi-target/files/ietd.conf b/recipes/iscsi-target/files/ietd.conf deleted file mode 100644 index 4ddfe9dc9e..0000000000 --- a/recipes/iscsi-target/files/ietd.conf +++ /dev/null @@ -1,17 +0,0 @@ -#Target iqn.2007-01.org.foonas:iSCSI.sda.target1 -# Lun 0 Path=/dev/sdb1,Type=blockio -# MaxConnections 1 -# HeaderDigest None -# DataDigest None -# InitialR2T Yes -# ImmediateData No -# MaxRecvDataSegmentLength 8192 -# MaxXmitDataSegmentLength 8192 -# MaxBurstLength 262144 -# FirstBurstLength 65536 -# DefaultTime2Wait 2 -# DefaultTime2Retain 20 -# MaxOutstandingR2T 8 -# DataPDUInOrder Yes -# DataSequenceInOrder Yes -# ErrorRecoveryLevel 0 diff --git a/recipes/iscsi-target/files/init b/recipes/iscsi-target/files/init deleted file mode 100644 index d000adfe3c..0000000000 --- a/recipes/iscsi-target/files/init +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# Start the iSCSI Enterprise Target. -# - -PATH=/sbin:/bin:/usr/sbin:/usr/bin - -start_server() -{ - modprobe -q crc32c - modprobe iscsi_trgt - start-stop-daemon --start --quiet --pidfile /var/run/iscsi_trgt.pid --exec /sbin/ietd -} - -stop_server() -{ - ietadm --op delete - start-stop-daemon --stop --quiet --pidfile /var/run/iscsi_trgt.pid --exec /sbin/ietd - sleep 1 - modprobe -r iscsi_trgt -} - -case "$1" in - start) - start_server - ;; - stop) - stop_server - ;; - *) - echo "Usage: {start|stop}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/recipes/iscsi-target/files/libs.patch b/recipes/iscsi-target/files/libs.patch deleted file mode 100644 index 5108027cc4..0000000000 --- a/recipes/iscsi-target/files/libs.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -urN iscsitarget-0.4.15/usr/Makefile iscsitarget-0.4.15.new/usr/Makefile ---- iscsitarget-0.4.15/usr/Makefile 2006-07-03 14:09:30.000000000 +0000 -+++ iscsitarget-0.4.15.new/usr/Makefile 2007-07-29 23:16:45.000000000 +0000 -@@ -1,6 +1,6 @@ - CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include - PROGRAMS = ietd ietadm --LIBS = -lcrypto -+LIBS = -lcrypto $(LDFLAGS) - - all: $(PROGRAMS) - diff --git a/recipes/iscsi-target/iscsi-target/2.6.29.patch b/recipes/iscsi-target/iscsi-target/2.6.29.patch new file mode 100644 index 0000000000..24c1afbdd1 --- /dev/null +++ b/recipes/iscsi-target/iscsi-target/2.6.29.patch @@ -0,0 +1,72 @@ +Index: iscsitarget-0.4.17/kernel/block-io.c +=================================================================== +--- iscsitarget-0.4.17/kernel/block-io.c (revision 198) ++++ iscsitarget-0.4.17/kernel/block-io.c (working copy) +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + #include "iscsi.h" + #include "iscsi_dbg.h" +@@ -154,14 +155,22 @@ + { + struct blockio_data *bio_data = volume->private; + struct block_device *bdev; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) + int flags = LUReadonly(volume) ? MS_RDONLY : 0; ++#else ++ fmode_t flags = LUReadonly(volume) ? FMODE_READ : (FMODE_READ | FMODE_WRITE); ++#endif + int err = 0; + + bio_data->path = kstrdup(path, GFP_KERNEL); + if (!bio_data->path) + return -ENOMEM; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) + bdev = open_bdev_excl(path, flags, THIS_MODULE); ++#else ++ bdev = open_bdev_exclusive(path, flags, THIS_MODULE); ++#endif + if (IS_ERR(bdev)) { + err = PTR_ERR(bdev); + eprintk("Can't open device %s, error %d\n", path, err); +@@ -324,8 +333,17 @@ + { + struct blockio_data *bio_data = volume->private; + +- if (bio_data->bdev) ++ if (bio_data->bdev) { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) + close_bdev_excl(bio_data->bdev); ++#else ++ if (LUReadonly(volume)) { ++ close_bdev_exclusive(bio_data->bdev, FMODE_READ); ++ } else { ++ close_bdev_exclusive(bio_data->bdev, FMODE_READ|FMODE_WRITE); ++ } ++#endif ++ } + kfree(bio_data->path); + + kfree(volume->private); +Index: iscsitarget-0.4.17/kernel/conn.c +=================================================================== +--- iscsitarget-0.4.17/kernel/conn.c (revision 198) ++++ iscsitarget-0.4.17/kernel/conn.c (working copy) +@@ -46,9 +46,13 @@ + "%u.%u.%u.%u", NIPQUAD(inet_sk(sk)->daddr)); + break; + case AF_INET6: ++#ifdef NIP6 + snprintf(buf, sizeof(buf), + "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]", + NIP6(inet6_sk(sk)->daddr)); ++#else ++ snprintf(buf, sizeof(buf), "[%p6]", &inet6_sk(sk)->daddr); ++#endif + break; + default: + break; diff --git a/recipes/iscsi-target/iscsi-target/2.6.31.patch b/recipes/iscsi-target/iscsi-target/2.6.31.patch new file mode 100644 index 0000000000..74c91f5d4c --- /dev/null +++ b/recipes/iscsi-target/iscsi-target/2.6.31.patch @@ -0,0 +1,16 @@ +Index: iscsitarget-1.4.19/patches/compat-2.6.31.patch +=================================================================== +--- /dev/null ++++ iscsitarget-1.4.19/patches/compat-2.6.31.patch +@@ -0,0 +1,11 @@ ++--- sync/kernel/file-io.c 2009-12-10 17:43:36.000000000 -0500 +++++ trunk/kernel/file-io.c 2008-12-04 17:35:21.000000000 -0500 ++@@ -88,7 +88,7 @@ ++ count = lu->blk_cnt << lu->blk_shift; ++ } ++ ++- res = filemap_write_and_wait_range(mapping, ppos, ppos + count - 1); +++ res = sync_page_range(inode, mapping, ppos, count); ++ if (res) { ++ eprintk("I/O error: syncing pages failed: %d\n", res); ++ return -EIO; diff --git a/recipes/iscsi-target/iscsi-target/2.6.32.patch b/recipes/iscsi-target/iscsi-target/2.6.32.patch new file mode 100644 index 0000000000..bda0d20470 --- /dev/null +++ b/recipes/iscsi-target/iscsi-target/2.6.32.patch @@ -0,0 +1,107 @@ +Index: x/kernel/file-io.c +=================================================================== +--- x/kernel/file-io.c (revision 276) ++++ x/kernel/file-io.c (working copy) +@@ -88,7 +88,7 @@ + count = lu->blk_cnt << lu->blk_shift; + } + +- res = sync_page_range(inode, mapping, ppos, count); ++ res = filemap_write_and_wait_range(mapping, ppos, ppos + count - 1); + if (res) { + eprintk("I/O error: syncing pages failed: %d\n", res); + return -EIO; +Index: x/dkms.conf +=================================================================== +--- x/dkms.conf (revision 276) ++++ x/dkms.conf (working copy) +@@ -20,33 +20,36 @@ + # Patches newest - oldest, distro spec at bottom + # + +-PATCH[0]="compat-2.6.29.patch" +-PATCH_MATCH[0]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29)" ++PATCH[0]="compat-2.6.31.patch" ++PATCH_MATCH[0]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)" + +-PATCH[1]="compat-2.6.28.patch" +-PATCH_MATCH[1]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28)" ++PATCH[1]="compat-2.6.29.patch" ++PATCH_MATCH[1]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29)" + +-PATCH[2]="compat-2.6.25-2.6.27.patch" +-PATCH_MATCH[2]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27)" ++PATCH[2]="compat-2.6.28.patch" ++PATCH_MATCH[2]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28)" + +-PATCH[3]="compat-2.6.24.patch" +-PATCH_MATCH[3]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24)" ++PATCH[3]="compat-2.6.25-2.6.27.patch" ++PATCH_MATCH[3]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27)" + +-PATCH[4]="compat-2.6.23.patch" +-PATCH_MATCH[4]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23)" ++PATCH[4]="compat-2.6.24.patch" ++PATCH_MATCH[4]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24)" + +-PATCH[5]="compat-2.6.22.patch" +-PATCH_MATCH[5]="2\.6\.(9|14|15|16|17|18|19|20|21|22)" ++PATCH[5]="compat-2.6.23.patch" ++PATCH_MATCH[5]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23)" + +-PATCH[6]="compat-2.6.19-2.6.21.patch" +-PATCH_MATCH[6]="2\.6\.(9|14|15|16|17|18|19|20|21)" ++PATCH[6]="compat-2.6.22.patch" ++PATCH_MATCH[6]="2\.6\.(9|14|15|16|17|18|19|20|21|22)" + +-PATCH[7]="compat-2.6.14-2.6.18.patch" +-PATCH_MATCH[7]="2\.6\.(9|14|15|16|17|18)" ++PATCH[7]="compat-2.6.19-2.6.21.patch" ++PATCH_MATCH[7]="2\.6\.(9|14|15|16|17|18|19|20|21)" + +-PATCH[8]="compat-sles10sp2.patch" +-PATCH_MATCH[8]="2\.6\.16\.60-.*" ++PATCH[8]="compat-2.6.14-2.6.18.patch" ++PATCH_MATCH[8]="2\.6\.(9|14|15|16|17|18)" + +-PATCH[9]="compat-rhel4.patch" +-PATCH_MATCH[9]="2\.6\.9-.*\.(el|plus\.c4)" ++PATCH[9]="compat-sles10sp2.patch" ++PATCH_MATCH[9]="2\.6\.16\.60-.*" + ++PATCH[10]="compat-rhel4.patch" ++PATCH_MATCH[10]="2\.6\.9-.*\.(el|plus\.c4)" ++ +Index: x/patches/compat-2.6.31.patch +=================================================================== +--- x/patches/compat-2.6.31.patch (revision 0) ++++ x/patches/compat-2.6.31.patch (revision 0) +@@ -0,0 +1,11 @@ ++--- sync/kernel/file-io.c 2009-12-10 17:43:36.000000000 -0500 +++++ trunk/kernel/file-io.c 2008-12-04 17:35:21.000000000 -0500 ++@@ -88,7 +88,7 @@ ++ count = lu->blk_cnt << lu->blk_shift; ++ } ++ ++- res = filemap_write_and_wait_range(mapping, ppos, ppos + count - 1); +++ res = sync_page_range(inode, mapping, ppos, count); ++ if (res) { ++ eprintk("I/O error: syncing pages failed: %d\n", res); ++ return -EIO; +Index: x/Makefile +=================================================================== +--- x/Makefile (revision 276) ++++ x/Makefile (working copy) +@@ -51,6 +51,11 @@ + # base first the earlier patch sets will not need to be modified. + # + ++# Compatibility patch for kernels <= 2.6.31 ++ifeq ($(call kver_le,2,6,31),1) ++ PATCHES := $(PATCHES) compat-2.6.31.patch ++endif ++ + # Compatibility patch for kernels <= 2.6.29 + ifeq ($(call kver_le,2,6,29),1) + PATCHES := $(PATCHES) compat-2.6.29.patch + diff --git a/recipes/iscsi-target/iscsi-target/Makefile.patch b/recipes/iscsi-target/iscsi-target/Makefile.patch new file mode 100644 index 0000000000..3340b07240 --- /dev/null +++ b/recipes/iscsi-target/iscsi-target/Makefile.patch @@ -0,0 +1,26 @@ +Index: iscsitarget-1.4.20.2/Makefile +=================================================================== +--- iscsitarget-1.4.20.2.orig/Makefile ++++ iscsitarget-1.4.20.2/Makefile +@@ -26,11 +26,9 @@ else + endif + endif + +-KVER := $(shell $(CC) $(CFLAGS) -E -dM $(VERSION_FILE) | \ ++KVER2 := $(shell $(CC) $(CFLAGS) -E -dM $(VERSION_FILE) | \ + grep UTS_RELEASE | awk '{ print $$3 }' | sed 's/\"//g') + +-KMOD := /lib/modules/$(KVER)/extra +- + KMAJ := $(shell echo $(KVER) | \ + sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*.*/\1/') + KMIN := $(shell echo $(KVER) | \ +@@ -185,6 +183,8 @@ integ_check: + $(PATCHES): .patched.$(KVER) + + .patched.$(KVER): ++ echo "KVER: " ${KVER} ++ echo "KREV: " ${KREV} + @set -e; \ + if [ ! -e .patched.* ]; then \ + for p in $(PATCHES); do \ diff --git a/recipes/iscsi-target/iscsi-target/ietd.conf b/recipes/iscsi-target/iscsi-target/ietd.conf new file mode 100644 index 0000000000..4ddfe9dc9e --- /dev/null +++ b/recipes/iscsi-target/iscsi-target/ietd.conf @@ -0,0 +1,17 @@ +#Target iqn.2007-01.org.foonas:iSCSI.sda.target1 +# Lun 0 Path=/dev/sdb1,Type=blockio +# MaxConnections 1 +# HeaderDigest None +# DataDigest None +# InitialR2T Yes +# ImmediateData No +# MaxRecvDataSegmentLength 8192 +# MaxXmitDataSegmentLength 8192 +# MaxBurstLength 262144 +# FirstBurstLength 65536 +# DefaultTime2Wait 2 +# DefaultTime2Retain 20 +# MaxOutstandingR2T 8 +# DataPDUInOrder Yes +# DataSequenceInOrder Yes +# ErrorRecoveryLevel 0 diff --git a/recipes/iscsi-target/iscsi-target/init b/recipes/iscsi-target/iscsi-target/init new file mode 100644 index 0000000000..d000adfe3c --- /dev/null +++ b/recipes/iscsi-target/iscsi-target/init @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Start the iSCSI Enterprise Target. +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +start_server() +{ + modprobe -q crc32c + modprobe iscsi_trgt + start-stop-daemon --start --quiet --pidfile /var/run/iscsi_trgt.pid --exec /sbin/ietd +} + +stop_server() +{ + ietadm --op delete + start-stop-daemon --stop --quiet --pidfile /var/run/iscsi_trgt.pid --exec /sbin/ietd + sleep 1 + modprobe -r iscsi_trgt +} + +case "$1" in + start) + start_server + ;; + stop) + stop_server + ;; + *) + echo "Usage: {start|stop}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/recipes/iscsi-target/iscsi-target/libs.patch b/recipes/iscsi-target/iscsi-target/libs.patch new file mode 100644 index 0000000000..5108027cc4 --- /dev/null +++ b/recipes/iscsi-target/iscsi-target/libs.patch @@ -0,0 +1,11 @@ +diff -urN iscsitarget-0.4.15/usr/Makefile iscsitarget-0.4.15.new/usr/Makefile +--- iscsitarget-0.4.15/usr/Makefile 2006-07-03 14:09:30.000000000 +0000 ++++ iscsitarget-0.4.15.new/usr/Makefile 2007-07-29 23:16:45.000000000 +0000 +@@ -1,6 +1,6 @@ + CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include + PROGRAMS = ietd ietadm +-LIBS = -lcrypto ++LIBS = -lcrypto $(LDFLAGS) + + all: $(PROGRAMS) + diff --git a/recipes/iscsi-target/iscsi-target_1.4.20.1.bb b/recipes/iscsi-target/iscsi-target_1.4.20.1.bb deleted file mode 100644 index bcf86f99f0..0000000000 --- a/recipes/iscsi-target/iscsi-target_1.4.20.1.bb +++ /dev/null @@ -1,47 +0,0 @@ -DESCRIPTION = "iSCSI Enterprise Target is for building an iSCSI storage system on Linux" -HOMEPAGE = "http://iscsitarget.sourceforge.net/" -LICENSE = "GPL" -PR = "r1" - -SRC_URI = "${SOURCEFORGE_MIRROR}/iscsitarget/iscsitarget-${PV}.tar.gz \ - file://ietd.conf \ - file://init" - -SRC_URI[md5sum] = "6e5e641b832d420e030d5efb59eca7ce" -SRC_URI[sha256sum] = "994186389911d41a0d2a65b7001ff060f778e2c77f80bd98e03776b215e0732c" -S = "${WORKDIR}/iscsitarget-${PV}" - - -DEPENDS = "openssl" -RRECOMMENDS_${PN} = "kernel-module-crc32c kernel-module-libcrc32c" - -inherit module - -do_configure() { -} - -CFLAGS = "-isystem${STAGING_KERNEL_DIR}/include -I${STAGING_INCDIR} -L${STAGING_LIBDIR}" -LDFLAGS = "-L${STAGING_LIBDIR}" -FILES_${PN} += " ${base_sbindir}" - -do_compile() { - oe_runmake KSRC=${STAGING_KERNEL_DIR} CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' -} - -do_install() { - # Module - install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/iscsi - install -m 0644 kernel/iscsi_trgt.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/iscsi/iscsi_trgt.ko - - # Userspace utilities - install -d ${D}${base_sbindir} - install -m 0755 usr/ietd ${D}${base_sbindir}/ietd - install -m 0755 usr/ietadm ${D}${base_sbindir}/ietadm - - # Config files, init scripts - mkdir -p ${D}${sysconfdir}/init.d - install -m 0755 ../init ${D}${sysconfdir}/init.d/iscsi-target - install -m 0644 ${WORKDIR}/ietd.conf ${D}${sysconfdir}/ - install -m 0644 etc/initiators.allow ${D}${sysconfdir}/ - install -m 0644 etc/initiators.deny ${D}${sysconfdir}/ -} diff --git a/recipes/iscsi-target/iscsi-target_1.4.20.2.bb b/recipes/iscsi-target/iscsi-target_1.4.20.2.bb new file mode 100644 index 0000000000..db85aba929 --- /dev/null +++ b/recipes/iscsi-target/iscsi-target_1.4.20.2.bb @@ -0,0 +1,56 @@ +DESCRIPTION = "iSCSI Enterprise Target is for building an iSCSI storage system on Linux" +HOMEPAGE = "http://iscsitarget.sourceforge.net/" +LICENSE = "GPL" +DEPENDS = "openssl" +RRECOMMENDS_${PN} = "kernel-module-crc32c kernel-module-libcrc32c" +PR = "r0" + +# this recipe has a DEFAULT_PREFERENCE -1 for beagleboard +# actually this probably is only needed for angstrom and minimal +# angstrom and minimal at the moment of writing use a kernel for beagleboard +# that advertises as 2.6.32 but has patches for 2.6.33 which cause +# this recipe to fail. It is not really possible to fix it in this +# recipe without breaking the recipes for other 2.6.32 kernels. +# Actually a patch for the offending kernel to make it more 2.6.32 compliant +# would be trivially simple and absolutely harmless, but the maintainer +# of that recipe was not willing to even consider a patch. +DEFAULT_PREFERENCE_beagleboard = "-1" + +SRC_URI = "${SOURCEFORGE_MIRROR}/iscsitarget/iscsitarget-${PV}.tar.gz \ + file://ietd.conf \ + file://init \ + file://Makefile.patch \ + " +SRC_URI[md5sum] = "2f23c0bfe124d79f5c20e34ef2aaff82" +SRC_URI[sha256sum] = "0f3c8e2c2038fbbd7059d1efdd428260013212daca75c1d56abbeec33cb8d388" + +S = "${WORKDIR}/iscsitarget-${PV}" + +inherit module + +do_configure() { +} +do_compile() { + oe_runmake KSRC=${STAGING_KERNEL_DIR} CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' +} + +do_install() { + # Module + install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/iscsi + install -m 0644 kernel/iscsi_trgt.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/iscsi/iscsi_trgt.ko + # Userspace utilities + install -d ${D}${base_sbindir} + install -m 0755 usr/ietd ${D}${base_sbindir}/ietd + install -m 0755 usr/ietadm ${D}${base_sbindir}/ietadm + # Config files, init scripts + mkdir -p ${D}${sysconfdir}/init.d + install -m 0755 ../init ${D}${sysconfdir}/init.d/iscsi-target + install -m 0644 ${WORKDIR}/ietd.conf ${D}${sysconfdir}/ + install -m 0644 etc/initiators.allow ${D}${sysconfdir}/ + install -m 0644 etc/initiators.deny ${D}${sysconfdir}/ +} + +FILES_${PN} += " ${base_sbindir}" +CFLAGS = "-isystem${STAGING_KERNEL_DIR}/include -I${STAGING_INCDIR} -L${STAGING_LIBDIR}" +LDFLAGS = "-L${STAGING_LIBDIR}" + -- cgit v1.2.3