Updates for the OFED 1.5 + kernel 2.6.30 combination.
authorbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Sat, 31 Oct 2009 13:06:39 +0000 (13:06 +0000)
committerbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Sat, 31 Oct 2009 13:06:39 +0000 (13:06 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1306 d57e44dd-8a1f-0410-8b47-8ef2f437770f

srpt/Makefile
srpt/README.ofed
srpt/patches/kernel-2.6.18-pre-cflags.patch [moved from srpt/patches/kernel-2.6.18-scripts-Makefile.lib.patch with 100% similarity]
srpt/patches/kernel-2.6.27-pre-cflags.patch [moved from srpt/patches/kernel-2.6.27-scripts-Makefile.lib.patch with 100% similarity]
srpt/patches/kernel-2.6.30-pre-cflags.patch [new file with mode: 0644]
srpt/patches/kernel-2.6.30-scripts-Makefile.lib.patch [deleted file]

index 9e1bdd1..a6f50e8 100644 (file)
@@ -69,10 +69,9 @@ src/Module.symvers src/Modules.symvers: $(SCST_DIR)/$(MODULE_SYMVERS)
          elif [ -e $(KDIR)/scripts/Makefile.lib ]                          \
               && ! grep -wq '^c_flags .*PRE_CFLAGS'                        \
                   $(KDIR)/scripts/Makefile.lib                              \
-              && ! grep -wq '^_c_flags .*PRE_CFLAGS'                       \
-                  $(KDIR)/scripts/Makefile.lib; then                        \
-           echo "Error: $(KDIR)/scripts/Makefile.lib has not yet"          \
-                "been patched.";                                           \
+              && ! grep -wq '^LINUXINCLUDE .*PRE_CFLAGS'                   \
+                  $(KDIR)/Makefile; then                                    \
+           echo "Error: the kernel build system has not yet been patched.";\
            false;                                                          \
          else                                                              \
            echo "  Building against OFED InfiniBand kernel headers.";      \
index a4725bf..fe9ebfd 100644 (file)
@@ -58,8 +58,12 @@ Remove any distro-provided InfiniBand drivers:
 Now locate the file Makefile.lib and patch it such that it supports
 the variable PRE_CFLAGS:
 
-  cd $(dirname $(find /lib/modules/$(uname -r)/build/ -name Makefile.lib))
-  patch -p1 < ${SCST_DIR}/srpt/patches/kernel-${KV}-scripts-Makefile.lib.patch
+  if -e /lib/modules/$(uname -r)/build/scripts/Makefile.lib; then
+    /lib/modules/$(uname -r)/build
+  else
+    cd /usr/src/linux-$(uname -r)
+  fi
+  patch -p0 < ${SCST_DIR}/srpt/patches/kernel-${KV}-pre-cflags.patch
 
 Next, download and install the OFED package. Make sure to disable
 OFED's SRP target driver (srpt=n) and to enable at least the
diff --git a/srpt/patches/kernel-2.6.30-pre-cflags.patch b/srpt/patches/kernel-2.6.30-pre-cflags.patch
new file mode 100644 (file)
index 0000000..4c43eae
--- /dev/null
@@ -0,0 +1,11 @@
+--- Makefile.orig      2009-10-31 13:49:29.000000000 +0100
++++ Makefile   2009-10-31 13:49:32.000000000 +0100
+@@ -342,7 +342,7 @@ AFLAGS_KERNEL      =
+ # Use LINUXINCLUDE when you must reference the include/ directory.
+ # Needed to be compatible with the O= option
+-LINUXINCLUDE    := -Iinclude \
++LINUXINCLUDE    := $(PRE_CFLAGS) -Iinclude \
+                    $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
+                    -I$(srctree)/arch/$(hdr-arch)/include               \
+                    -include include/linux/autoconf.h
diff --git a/srpt/patches/kernel-2.6.30-scripts-Makefile.lib.patch b/srpt/patches/kernel-2.6.30-scripts-Makefile.lib.patch
deleted file mode 100644 (file)
index c7c37a2..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- /lib/modules/2.6.30.9-scst-debug/build/scripts/Makefile.lib.orig   2009-06-10 05:05:27.000000000 +0200
-+++ /lib/modules/2.6.30.9-scst-debug/build/scripts/Makefile.lib        2009-10-27 20:20:19.000000000 +0100
-@@ -111,7 +111,7 @@
- orig_c_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \
-                  $(ccflags-y) $(CFLAGS_$(basetarget).o)
--_c_flags       = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))
-+_c_flags       = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags)) $(PRE_CFLAGS)
- _a_flags       = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
-                  $(asflags-y) $(AFLAGS_$(basetarget).o)
- _cpp_flags     = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))