@ponce you are the man! The patch really works. But using --apply-patch option with Nvidia installer is little tricky. For others how I did this: file containning patch is 4.14_kernel_patch, so let the Nvidia blob be in /tmp
Code:
$ ls /tmp
NVIDIA-Linux-x86_64-304.137.run
as root
Code:
# cd /tmp
# ./NVIDIA-Linux-x86_64-304.137.run --apply-patch 4.14_kernel.patch
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 304.137................................................................................................................................................................
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ur a/kernel/nv-drm.c b/kernel/nv-drm.c
|--- a/kernel/nv-drm.c 2017-09-14 23:51:09.000000003 +0300
|+++ b/kernel/nv-drm.c 2017-12-06 18:47:48.279729889 +0200
--------------------------
File to patch:
when see this "File to patch:" it is query from patch program, you should answer with "kernel/nv-drm.c",now the things go on
Code:
File to patch: kernel/nv-drm.c
patching file kernel/nv-drm.c
Adding files to archive named "NVIDIA-Linux-x86_64-304.137-custom.run"...
./libglx.so.304.137
./libnvidia-ml.so.304.137
.
.
.
./README.txt
./pkg-history.txt
./tls_test_dso.so
CRC: 3850583096
MD5: a6e95808e7e8fc46424aa975829885e8
Self-extractible archive "NVIDIA-Linux-x86_64-304.137-custom.run" successfully created.
finally in /tmp appears new patched driver with extension -custom.run
Code:
# ls /tmp
NVIDIA-Linux-x86_64-304.137-custom.run
NVIDIA-Linux-x86_64-304.137.run
now
Code:
# ./NVIDIA-Linux-x86_64-304.137-custom.run
compiled kernel module and installed correctly driver, at least for me.
I am not specialist bu I may guess problem is in header of patch
Code:
diff -ur a/kernel/nv-drm.c b/kernel/nv-drm.c
--- a/kernel/nv-drm.c 2017-09-14 23:51:09.000000003 +0300
+++ b/kernel/nv-drm.c 2017-12-06 18:47:48.279729889 +0200
I mean look at "a/kernel" vs "b/kernel" paths. Maybe for fully automatic process the header needs to be changed, the prefixes "a/" "b/" should be dropped, so header will be
Code:
diff -ur kernel/nv-drm.c kernel/nv-drm.c
--- kernel/nv-drm.c 2017-09-14 23:51:09.000000003 +0300
+++ kernel/nv-drm.c 2017-12-06 18:47:48.279729889 +0200