From e09e9397829cd30575abdac93580abae692bad74 Mon Sep 17 00:00:00 2001 From: bvassche Date: Sat, 31 Oct 2009 13:06:39 +0000 Subject: [PATCH] Updates for the OFED 1.5 + kernel 2.6.30 combination. git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1306 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/Makefile | 7 +++---- srpt/README.ofed | 8 ++++++-- ...efile.lib.patch => kernel-2.6.18-pre-cflags.patch} | 0 ...efile.lib.patch => kernel-2.6.27-pre-cflags.patch} | 0 srpt/patches/kernel-2.6.30-pre-cflags.patch | 11 +++++++++++ srpt/patches/kernel-2.6.30-scripts-Makefile.lib.patch | 11 ----------- 6 files changed, 20 insertions(+), 17 deletions(-) rename srpt/patches/{kernel-2.6.18-scripts-Makefile.lib.patch => kernel-2.6.18-pre-cflags.patch} (100%) rename srpt/patches/{kernel-2.6.27-scripts-Makefile.lib.patch => kernel-2.6.27-pre-cflags.patch} (100%) create mode 100644 srpt/patches/kernel-2.6.30-pre-cflags.patch delete mode 100644 srpt/patches/kernel-2.6.30-scripts-Makefile.lib.patch diff --git a/srpt/Makefile b/srpt/Makefile index 9e1bdd1..a6f50e8 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -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."; \ diff --git a/srpt/README.ofed b/srpt/README.ofed index a4725bf..fe9ebfd 100644 --- a/srpt/README.ofed +++ b/srpt/README.ofed @@ -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.18-scripts-Makefile.lib.patch b/srpt/patches/kernel-2.6.18-pre-cflags.patch similarity index 100% rename from srpt/patches/kernel-2.6.18-scripts-Makefile.lib.patch rename to srpt/patches/kernel-2.6.18-pre-cflags.patch diff --git a/srpt/patches/kernel-2.6.27-scripts-Makefile.lib.patch b/srpt/patches/kernel-2.6.27-pre-cflags.patch similarity index 100% rename from srpt/patches/kernel-2.6.27-scripts-Makefile.lib.patch rename to srpt/patches/kernel-2.6.27-pre-cflags.patch 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 index 0000000..4c43eae --- /dev/null +++ b/srpt/patches/kernel-2.6.30-pre-cflags.patch @@ -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 index c7c37a2..0000000 --- a/srpt/patches/kernel-2.6.30-scripts-Makefile.lib.patch +++ /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)) -- 2.17.1