NVIDIA – Auto-Patching..
As we seem to be stuck for some time with NVIDIA drivers incompatible with the latest kernels, patching seems to be more of a necessity, now.
Thanks to a comment from Giordano, I have learned of a way to ‘automatically’ patch any NVIDIAxxxxxx.run file directly, and re-create a corresponding NVIDIAxxxxxx.run file which includes the patch.. The help function does not go into much actual detail, but by the usual trial and error I managed to figure it out!
The command format is:
# ./NVIDIAxxxxxx.run --apply-patch <patch-file-name> or (on some systems) # sh ./NVIDIAxxxxxx.run --apply-patch <patch-file-name>
– and will give a corresponding ‘patched’ self-extracting/executing file called NVIDIAxxxxxx-custom.run
The only quirk, is that the patch file itself needs to be in a certain format..
Many patch files contain a specific reference to the files to be patched, as follows:
--- NVIDIA-Linux-x86_64-319.60/kernel/nv-drm.c 2013-09-26 01:02:38.000000000 +0400 +++ NVIDIA-Linux-x86_64-319.60/kernel/nv-drm.c 2013-09-26 01:02:38.000000000 +0400
Or – in some cases:
--- a/kernel/nv-drm.c 2013-09-26 01:02:38.000000000 +0400 +++ b/kernel/nv-drm.c 2013-09-26 01:02:38.000000000 +0400
But – for the ‘auto patch’, this needs to be changed to
--- kernel/nv-drm.c 2013-09-26 01:02:38.000000000 +0400 +++ kernel/nv-drm.c 2013-09-26 01:02:38.000000000 +0400
Then (for example):
# ./NVIDIA-Linux-x86_64-319.60.run --apply-patch nvidia_312_patch_run.patch Verifying archive integrity... OK Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 319.60............. ..................................................................................... patching file kernel/nv-drm.c patching file kernel/nv-linux.h ................. Adding files to archive named "NVIDIA-Linux-x86_64-319.60-custom.run"... ./libvdpau.so.319.60 ./.manifest ./glxext.h ./glx.h ./mkprecompiled ./libGL.la ./glext.h <long list of files...> ./nvidia-smi.1.gz ./nvidia-persistenced ./libnvidia-ml.so.319.60 ./nvidia-installer.1.gz ./gl.h ./libnvidia-ifr.so.319.60 CRC: 2418980242 MD5: d593f39a7b899b47502c7f1c3e808e96 Self-extractible archive "NVIDIA-Linux-x86_64-319.60-custom.run" successfully created.
This patched NVIDIA-Linux-x86_64-319.60-custom.run can then be used in place of the original..
Of course, as I write this, and after many weeks of waiting, I have just noticed there is – finally – an updated NVIDIA driver on the download site!
Robert Gadsdon. October 23, 2013.
Comments
NVIDIA – Auto-Patching.. — No Comments