From: Ross S. W. W. <RW...@me...> - 2008-08-12 19:19:58
|
Sorry all I have been sitting on this for a while. This allows building of IET on older kernels that have the newer crypto APIs (i.e. Suse SP2). It's basically the 2.6.14-2.6.18 patch with the crypto part stripped and a definition in the Makefile that must be user set or passed in on the command line. If the variable NEW_CRYPTO is set then the compatibility patch without the crypto is used, otherwise the standard compatibility patch is used. There was one offset in the 2.6.19-2.6.21 compatibility patch that is fixed too. -Ross Index: patches/compat-2.6.14-2.6.18-crypto.patch =================================================================== --- patches/compat-2.6.14-2.6.18-crypto.patch (revision 0) +++ patches/compat-2.6.14-2.6.18-crypto.patch (revision 0) @@ -0,0 +1,42 @@ +Index: kernel/file-io.c +=================================================================== +--- kernel/file-io.c (revision 105) ++++ kernel/file-io.c (working copy) +@@ -52,9 +52,9 @@ static int fileio_make_request(struct ie + set_fs(get_ds()); + + if (rw == READ) +- ret = do_sync_read(filp, buf, count, &ppos); ++ ret = generic_file_read(filp, buf, count, &ppos); + else +- ret = do_sync_write(filp, buf, count, &ppos); ++ ret = generic_file_write(filp, buf, count, &ppos); + + set_fs(oldfs); + +Index: kernel/iscsi.c +=================================================================== +--- kernel/iscsi.c (revision 105) ++++ kernel/iscsi.c (working copy) +@@ -15,7 +15,7 @@ + + unsigned long debug_enable_flags; + +-static struct kmem_cache *iscsi_cmnd_cache; ++static kmem_cache_t *iscsi_cmnd_cache; + static char dummy_data[1024]; + + static int ctr_major; +Index: kernel/tio.c +=================================================================== +--- kernel/tio.c (revision 105) ++++ kernel/tio.c (working copy) +@@ -35,7 +35,7 @@ static int tio_add_pages(struct tio *tio + return 0; + } + +-static struct kmem_cache *tio_cache; ++static kmem_cache_t *tio_cache; + + struct tio *tio_alloc(int count) + { Index: patches/compat-2.6.19-2.6.21.patch =================================================================== --- patches/compat-2.6.19-2.6.21.patch (revision 151) +++ patches/compat-2.6.19-2.6.21.patch (working copy) @@ -16,7 +16,7 @@ =================================================================== --- kernel/iscsi.c (working copy) +++ kernel/iscsi.c (revision 137) -@@ -1757,7 +1757,8 @@ static int iscsi_init(void) +@@ -1762,7 +1762,8 @@ static int iscsi_init(void) if ((err = event_init()) < 0) goto err; Index: Makefile =================================================================== --- Makefile (revision 151) +++ Makefile (working copy) @@ -7,6 +7,13 @@ # # Note 2! The CFLAGS definitions are now in the main makefile. +# Uncomment if your distro has backported the newer crypto interface +# to a kernel that normally didn't support it (kernels 2.6.18 and <) +# Currently SLES10 SP2 has backported this, but others may follow +# To-do: Write test to auto-determine if you have new crypto api +# +#NEW_CRYPTO := 1 + #export KSRC := /usr/src/linux SUBDIRS := $(shell pwd) @@ -45,11 +52,13 @@ echo 1 || echo 0) kver_lk = $(shell [ `echo $(KVER) | egrep $(1)` ] && echo 1 || echo 0) + # # Please when adding patch sets start with the latest to the earliest # the idea behind this is that by properly patching the latest code # base first the earlier patch sets will not need to be modified. # +# Place any distro-specific patch sets at the end # Compatibility patch for kernels >= 2.6.22 and <= 2.6.23 ifeq ($(call kver_le,2,6,23),1) @@ -63,7 +72,12 @@ # Compatibility patch for kernels >= 2.6.14 and <= 2.6.18 ifeq ($(call kver_le,2,6,18),1) - PATCHES := $(PATCHES) compat-2.6.14-2.6.18.patch + # Compatibility patch with new crypto + ifeq ($(NEW_CRYPTO),1) + PATCHES := $(PATCHES) compat-2.6.14-2.6.18-crypto.patch + else + PATCHES := $(PATCHES) compat-2.6.14-2.6.18.patch + endif endif # We don't support kernels < 2.6.14 except for explicit distros ______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof. |