commit 33ccd5ab1f55bc88ae21c6039d8f9db702ef7d19
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Sat Sep 23 09:47:20 2017 +0100
Patch for 4.13 kernel
4.13_hack_license_as_kernel_devs_hate_us.patch | 93 ++++++++++++++++++++++++++
nvidia-kmod.spec | 7 +-
2 files changed, 99 insertions(+), 1 deletion(-)
---
diff --git a/4.13_hack_license_as_kernel_devs_hate_us.patch
b/4.13_hack_license_as_kernel_devs_hate_us.patch
new file mode 100644
index 0000000..eddcb4c
--- /dev/null
+++ b/4.13_hack_license_as_kernel_devs_hate_us.patch
@@ -0,0 +1,93 @@
+diff -uNrp a/kernel/nvidia/nv.c b/kernel/nvidia/nv.c
+--- a/kernel/nvidia/nv.c 2017-09-20 02:33:09.000000000 +0100
++++ b/kernel/nvidia/nv.c 2017-09-23 08:43:37.590119035 +0100
+@@ -38,8 +38,12 @@
+
+ #if (NV_BUILD_MODULE_INSTANCES != 0)
+ #if defined(MODULE_LICENSE)
++#if LINUX_VERSION_CODE > KERNEL_VERSION(4, 13, 0)
++MODULE_LICENSE("GPL");
++#else
+ MODULE_LICENSE("NVIDIA");
+ #endif
++#endif
+ #if defined(MODULE_INFO)
+ MODULE_INFO(supported, "external");
+ #endif
+diff -uNrp a/kernel/nvidia/nv-frontend.c b/kernel/nvidia/nv-frontend.c
+--- a/kernel/nvidia/nv-frontend.c 2017-09-20 02:33:10.000000000 +0100
++++ b/kernel/nvidia/nv-frontend.c 2017-09-23 08:46:59.087803132 +0100
+@@ -15,8 +15,12 @@
+ #include "nv-frontend.h"
+
+ #if defined(MODULE_LICENSE)
++#if LINUX_VERSION_CODE > KERNEL_VERSION(4, 13, 0)
++MODULE_LICENSE("GPL");
++#else
+ MODULE_LICENSE("NVIDIA");
+ #endif
++#endif
+ #if defined(MODULE_INFO)
+ MODULE_INFO(supported, "external");
+ #endif
+diff -uNrp a/kernel/nvidia-drm/nvidia-drm-linux.c b/kernel/nvidia-drm/nvidia-drm-linux.c
+--- a/kernel/nvidia-drm/nvidia-drm-linux.c 2017-09-20 02:33:13.000000000 +0100
++++ b/kernel/nvidia-drm/nvidia-drm-linux.c 2017-09-23 09:25:40.161980854 +0100
+@@ -23,6 +23,7 @@
+ #include <linux/module.h>
+ #include <linux/slab.h>
+ #include <linux/err.h>
++#include <linux/version.h>
+
+ #include "nvidia-drm-os-interface.h"
+ #include "nvidia-drm.h"
+@@ -185,8 +186,12 @@ module_init(nv_linux_drm_init);
+ module_exit(nv_linux_drm_exit);
+
+ #if defined(MODULE_LICENSE)
++#if LINUX_VERSION_CODE > KERNEL_VERSION(4, 13, 0)
++ MODULE_LICENSE("Dual MIT/GPL");
++#else
+ MODULE_LICENSE("MIT");
+ #endif
++#endif
+ #if defined(MODULE_INFO)
+ MODULE_INFO(supported, "external");
+ #endif
+diff -uNrp a/kernel/nvidia-modeset/nvidia-modeset-linux.c
b/kernel/nvidia-modeset/nvidia-modeset-linux.c
+--- a/kernel/nvidia-modeset/nvidia-modeset-linux.c 2017-09-20 02:33:12.000000000 +0100
++++ b/kernel/nvidia-modeset/nvidia-modeset-linux.c 2017-09-23 09:03:19.673090364 +0100
+@@ -21,6 +21,7 @@
+ #include <linux/random.h>
+ #include <linux/file.h>
+ #include <linux/list.h>
++#include <linux/version.h>
+
+ #include "nvstatus.h"
+
+@@ -1309,8 +1310,12 @@ module_init(nvkms_init);
+ module_exit(nvkms_exit);
+
+ #if defined(MODULE_LICENSE)
++#if LINUX_VERSION_CODE > KERNEL_VERSION(4, 13, 0)
++ MODULE_LICENSE("GPL");
++#else
+ MODULE_LICENSE("NVIDIA");
+ #endif
++#endif
+ #if defined(MODULE_INFO)
+ MODULE_INFO(supported, "external");
+ #endif
+diff -uNrp a/kernel/nvidia-uvm/uvm_common.c b/kernel/nvidia-uvm/uvm_common.c
+--- a/kernel/nvidia-uvm/uvm_common.c 2017-09-20 02:33:10.000000000 +0100
++++ b/kernel/nvidia-uvm/uvm_common.c 2017-09-23 09:02:44.989610766 +0100
+@@ -388,5 +388,9 @@ module_param(uvm_enable_builtin_tests, i
+ MODULE_PARM_DESC(uvm_enable_builtin_tests,
+ "Enable the UVM built-in tests. (This is a security risk)");
+
++#if LINUX_VERSION_CODE > KERNEL_VERSION(4, 13, 0)
++MODULE_LICENSE("Dual MIT/GPL");
++#else
+ MODULE_LICENSE("MIT");
++#endif
+ MODULE_INFO(supported, "external");
diff --git a/nvidia-kmod.spec b/nvidia-kmod.spec
index d4dc994..d970f32 100644
--- a/nvidia-kmod.spec
+++ b/nvidia-kmod.spec
@@ -10,7 +10,7 @@ Name: nvidia-kmod
Epoch: 2
Version: 384.90
# Taken over by kmodtool
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: NVIDIA display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -19,6 +19,7 @@ URL:
http://www.nvidia.com/
Source11: nvidia-kmodtool-excludekernel-filterfile
Patch0: nv-linux-arm.patch
Patch1: nv-linux-arm2.patch
+Patch2: 4.13_hack_license_as_kernel_devs_hate_us.patch
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i686 x86_64 armv7hl
@@ -44,6 +45,7 @@ tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{versi
# patch loop
%patch0 -p1
%patch1 -p1
+%patch2 -p1
for kernel_version in %{?kernel_versions} ; do
cp -a kernel _kmod_build_${kernel_version%%___*}
@@ -71,6 +73,9 @@ done
%changelog
+* Sat Sep 23 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 2:384.90-2
+- Patch for 4.13 kernel
+
* Thu Sep 21 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 2:384.90-1
- Update to 384.90 release