flatcar-scripts/sdk_container
Jeremi Piotrowski d01ecae74c x11-drivers/nvidia-drivers: make service re-entrant
Currently the setup-nvidia script fails when re-executed. It should work in
cases when the driver is already built and just needs to be loaded, or when it
needs to be rebuilt for a new kernel (but driver version may not have changed).

To make this work, several changes where necessary:

* `./nvidia*.run -x -s` fails when already unpacked. Allow it so that we can
  rebuild
* there are several module dependencies for nvidia modules that are implicit,
  related to i2c/ipmi. Probe those explicitly.
* `[ -f /dev/nvidia* ]` fails because those are character devices, so need a
  `[ -c ...]` check.
* `nvidia-modprobe` previously always failed, because it doesn't actually know
  the location of the modules and can only call modprobe (modprobe looks into
  /lib/modules/). We now explicitly probe the important modules, at that point
  nvidia-modprobe just creates additional device nodes.
* `is_nvidia_installation_required` checks whether building and loading is needed.
  Factor out the loading check so that we can reload the module after an update.
2022-04-25 12:35:29 +02:00
..
src/third_party/coreos-overlay x11-drivers/nvidia-drivers: make service re-entrant 2022-04-25 12:35:29 +02:00