I have a scenario where I need to recompile my display drivers after kernel updates. I'm trying to automate it with Bash scripts during boot time. So I need a way to know that my kernel changed, and reinstall my drivers for the new running kernel.
I was thinking of when first installing my drivers output the kernel version to a file and in my script always checking if this file content is different than what is now installed.
Is this the right way? I would appreciate any suggestion on how to know if the kernel changed since I last installed my drivers.
- I know there is DKMS and that is exactly what is for but it's not always working so I want to do this in a different way.