I'm sorry that patch was too dirty.
I spent more thorough testing for i386 and amd64 architectures and
eliminated FTBFS.
This patch has helped me and will help you.

-- 
SY,
Konstantin Demin
--- a/debian/module/conftest.h
+++ b/debian/module/conftest.h
@@ -540,7 +540,7 @@
 #endif
 
 /* Implement conftest.sh function write_cr4 */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0))
  #define NV_WRITE_CR4_PRESENT
 #else
  #undef NV_WRITE_CR4_PRESENT

--- /dev/null
+++ b/debian/module/debian/patches/cleanse-kbuild.patch
@@ -0,0 +1,11 @@
+--- a/Kbuild
++++ b/Kbuild
+@@ -65,7 +65,7 @@ endif
+ # Make sure KBUILD understands that we want a module.
+ #
+ 
+-CORE_OBJS := nv-kernel.o
++CORE_OBJS :=
+ 
+ FRONTEND_GLUE_OBJS := $(patsubst %.c,%.o,nv-frontend.c)
+ INSTANCE_GLUE_OBJS := $(patsubst %.c,%.o,nv-instance.c)

--- /dev/null
+++ b/debian/module/debian/patches/dentry.patch
@@ -0,0 +1,11 @@
+--- a/nv-linux.h
++++ a/nv-linux.h
+@@ -2050,7 +2050,7 @@
+ #if defined(NV_FILE_HAS_INODE)
+ #define NV_FILE_INODE(file) (file)->f_inode
+ #else
+-#define NV_FILE_INODE(file) (file)->f_dentry->d_inode
++#define NV_FILE_INODE(file) (file)->f_path.dentry->d_inode
+ #endif
+ 
+ /* Stub out UVM in multi-RM builds */

--- a/debian/module/debian/patches/series
+++ b/debian/module/debian/patches/series
@@ -3,3 +3,5 @@ avoid-ld.gold.patch
 use-nv-kernel-ARCH.o_shipped.patch
 conditionally-include-linux_version.h.patch
 uvm-symvers.patch
+dentry.patch
+cleanse-kbuild.patch

--- a/debian/rules
+++ b/debian/rules
@@ -196,12 +196,17 @@ build-kernel-source-tree: install-into-tmp
 	mv $(module_source)/conftest.sh $(module_source)/conftest_nvidia.sh
 
 	# For the nvidia-uvm module.
+	test -d $(module_source)/uvm || cp -r NVIDIA-Linux-amd64/kernel/uvm $(module_source)/
+	test -d $(module_source)/uvm || cp -r NVIDIA-Linux-i386/kernel/uvm $(module_source)/
+	test -d $(module_source)/uvm || cp -r NVIDIA-Linux-armhf/kernel/uvm $(module_source)/
 	test ! -f $(module_source)/uvm/Makefile || \
 		mv $(module_source)/uvm/Makefile $(module_source)/uvm/Kbuild
 	test ! -d $(module_source)/uvm || \
 		ln -sf ../Makefile $(module_source)/uvm
 	test ! -d $(module_source)/uvm || \
 		ln -sf ../conftest.sh $(module_source)/uvm
+	test ! -d $(module_source)/uvm || \
+		ln -sf ../conftest.h $(module_source)/uvm
 
 	# We may need nv-kernel.o for several architectures to accomodate
 	# all kernel flavors. Use Kbuild-compatible names.

Reply via email to