Background: I've been running Ubuntu for years (started at 16.04, now at 20.04), and been constantly fighting with NVIDA drivers which I need as I use CUDA. As recently as yesterday, my NVIDIA 460 drivers were working fine, and an apt upgrade broke them again: Ubuntu 20.4 update broke my Nvidia 460 driver config
What I want to achieve:
- Create a restore point of a kernel and its modules (eg nvidia drivers) I'm happy with
- Whenever NVIDIA drivers break (or something else breaks badly), restore it
What I already have:
- GRUB which seems to allow choosing specific kernels to boot from
(screenshots for illustration, not reflecting latest version)

Questions:
Restore point containing kernel+modules: is it possible to create (if so how), or am I simply misunderstanding how kernels & modules are managed on linux (ie a kernel wouldn't include the nvidia drivers) ?
Restoring from grub: It seems
/etc/grub.d/40_customis the file I want to modify as it's designed specifically for custom menu entries. Do you confirm this is the intended way of booting custom kernels or should I be looking at another file?
/etc/grub.d/40_custom:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

- Which module contains which packages. See https://askubuntu.com/a/1259815/226614 for an example on how to go from module to package (and how it solved a specific problem).
- Making sure old kernels don't get deleted. See https://help.ubuntu.com/community/RemoveOldKernels , depending on your configuration, they might be automatically removed or not...
– sancho.s ReinstateMonicaCellio Mar 19 '21 at 16:19Again, if you post a specific example of a case you could not work, that would help.
– sancho.s ReinstateMonicaCellio Mar 19 '21 at 16:23