Link nvidia drivers explicitly.

It turns out that the nvidia-installer does not link the drivers
correctly, because linking the drivers needs the kernel's module.lds
linker script. Nvidia recommended to us that we link the modules
explicitly.

Doing this requires also having the kernel headers installed (which
includes module.lds). To simplify, we install the kernel headers in the
same directory structure as the standalone toolchain. This means that no
additional changes are needed for correct dependency caching to work.
Since we are installing the kernel headers as part of the toolchain
installation, we remove the existing function for installing the kernel
headers, which was dead code anyway (nothing called that function).
Furthermore, the kernel headers have no value without the toolchain (the
only use case for the kernel headers is to compile code that targets
COS).

One complication here is that this change introduces an incompatibility
between the cos-gpu-installer and the driver signatures. Signatures
produced by the new linking procedure cannot be consumed by old versions
of cos-gpu-installer. To help with this, we still keep the old linking
behavior as a fallback functionality. If GKE, for example, happens to
deploy a new cos-gpu-installer on an old COS version, nothing bad will
happen. The fallback behavior also allows the timing to be less strict
when we update images vs when we update the signer.

We also enable installation on beta images now, since we expect that to
work now.

Since github.com/pkg/errors is deprecated, new code uses the standard
library errors package instead.

BUG=b/200957688
TEST=Manually ran the following test scenarios:
- Tested with live cos-85 and cos-89 versions, using production drivers
- Tested with live cos-93, using unsigned drivers
- Signed live driver with new cos-gpu-installer, installed on live
  cos-85 with new cos-gpu-installer
- Signed live driver with new cos-gpu-installer, installed on live
  cos-89 with new cos-gpu-installer
- Signed pre-release driver with new cos-gpu-installer, installed on
  live cos-93 with new cos-gpu-installer

Change-Id: I1451694fd3d41c9c04f08023291e1cdb6413fd8c
Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/23430
Cloud-Build: GCB Service account <228075978874@cloudbuild.gserviceaccount.com>
Reviewed-by: Ke Wu <mikewu@google.com>
Tested-by: Robert Kolchmeyer <rkolchmeyer@google.com>
4 files changed
tree: 852461250e014d833285e3ec1906fe544e6dc43b
  1. release/
  2. src/
  3. testing/
  4. BUILD.bazel
  5. cloudbuild.yaml
  6. CONTRIBUTING.md
  7. deps.bzl
  8. go.mod
  9. go.sum
  10. LICENSE
  11. README.md
  12. run_tests.sh
  13. WORKSPACE
README.md

Tools for Container-Optimized OS

This is a repository of various tools developed for Container-Optimized OS. Examples include cos-gpu-installer, cos-toolbox, etc.

See CONTRIBUTING.md for how to contribute.