nvidia-patch icon indicating copy to clipboard operation
nvidia-patch copied to clipboard

Can the patch patterns be made more accesible for external use?

Open hacker1024 opened this issue 2 years ago • 3 comments

Hello, I'd love to package a patched driver with Nix (for local use, not redistribution - everything installed on NixOS must be packaged).

Would it be possible to make the patch patterns accessible for use outside the patching scripts? Perhaps in JSON form, or even as a separate shell script that can be sourced independently?

hacker1024 avatar Dec 23 '22 16:12 hacker1024

I've considered this before, but unfortunately splitting out the hex patterns will be a breaking change for many users who have automated tooling to simply

$ curl https://raw.githubusercontent.com/keylase/nvidia-patch/master/patch.sh | sh

With the change they will need to fetch a separate file with the hex patterns.

What if you extract the patch patterns using a clever grep on the script instead? Try this:

$ curl https://raw.githubusercontent.com/keylase/nvidia-patch/master/patch.sh | grep -Ezo "declare.*.so'.\)."

jailuthra avatar Jan 06 '23 11:01 jailuthra

Grepping can work, but that is also subject to breakage and not a very elegant solution.

What if the patch script downloaded the hex pattern file if it was missing? One-line automated invocations already require Internet access.

hacker1024 avatar Jan 19 '23 07:01 hacker1024

@hacker1024 Feel free to send a PR with your proposed change

jailuthra avatar Jan 20 '23 03:01 jailuthra