I have a kernel driver that fails to compile, I have a patch to fix it but every time I run dkms build ... the driver sources (in /usr/src) are restored, is there a way to add a custom patch to a dkms driver?


It was simpler and took less time than I anticipated, as man 8 dkms says just put them in/usr/src/<module>-<module-version>/patches/and then add the file name of the patch indkms.conf of the module with PATCH[#]=

I wonder what will happen when the module is updated.

  • put it on hold (apt-mark hold ...) , at least you'll know when to check.
    – A.B
    Aug 11 '19 at 16:28
  • @A.B Thanks for the suggestion, it's the nvidia driver, if something goes wrong I should notice (Xorg won't work). I imagine that for a major change there will be a new directory (so no custom patch), while for a minor change dkms.conf could be overwritten, maybe the patches/ directory will be deleted, nothing serious :-)
    – Alex
    Aug 11 '19 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.