cos-dkms: Add option to infer kernel version from build id

When --kernel-version=cos-default is passed, the kernel version will be
inferred from the kernel headers for that build. This makes it easier to
1. use cos-dkms to build kernel modules for multiple COS builds, and
2. use cos-dkms to build kernel modules from a non-COS machine.

BUG=None
TEST=presubmit, on a cloudtop: `docker run -it -v $PWD:/usr/src/mymodule-1.0 cos-dkms:test build mymodule/1.0 --install-build-dependencies --make-variables=cos-default --build-id=19126.0.0 --kernel-version=cos-default`

Change-Id: I858762197b71c0e89819755f7b80ee84b2648e78
Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/106177
Reviewed-by: Shuo Yang <gshuoy@google.com>
Cloud-Build: GCB Service account <228075978874@cloudbuild.gserviceaccount.com>
Tested-by: Kevin Berry <kpberry@google.com>
3 files changed
tree: 28479b9122b0a1e7502aeaa460ecc2f999237059
  1. coverage/
  2. release/
  3. src/
  4. testing/
  5. .gitignore
  6. BUILD.bazel
  7. cloudbuild.yaml
  8. CONTRIBUTING.md
  9. deps.bzl
  10. go.mod
  11. go.sum
  12. LICENSE
  13. postsubmit-cloudbuild.yaml
  14. README.md
  15. run_builds.sh
  16. run_unit_tests.sh
  17. 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.