Refactor cos-gpu-installer part2

Purely structural cleanup with no functional or CLI behavior changes:
- Extract shared userspace installation and .run extraction logic (DownloadToInstallDir, extractInstaller, installUserLibs, copyLibStdCpp,findDriverVersionManifestFile) from precompiled.go into internal/installer/userspace.go, deduplicating extraction with prebuilt.go.
- Extract version.ParseLegacyDriverVersion from commands/list.go and version.ParseMajorVersion shared across resolver.go, firmware.go, and modules.go.
- Remove unused transitional wrappers, dead v1 signing helpers, unused kernelOpen/test parameters and struct fields, and the redundant version.KernelModuleFlavor wrapper.
- Hoist function-local regexp.MustCompile calls to package-level vars and replace deprecated io/ioutil and github.com/golang/protobuf/proto usages.
- Enable the existing userParamSet assertions in TestSetCoherentGPUMemoryMode and update signature_test.go to cover DownloadDriverSignaturesV2.

BUG=b/577289798
TEST=installed GPU drivers in VMs.

Change-Id: Ibfed4ead7f35b6945fd3c70b3de33deb9eaa7d6f
Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/242606
Cloud-Build: 228075978874@cloudbuild.gserviceaccount.com <228075978874@cloudbuild.gserviceaccount.com>
Tested-by: He Gao <hegao@google.com>
AI-Review: cloud-image-release <cloud-image-release@prod.google.com>
Reviewed-by: Chenglong Tang <chenglongtang@google.com>
20 files changed
tree: 07464e0277147e2d2227128f8a62ab94c3148020
  1. coverage/
  2. release/
  3. src/
  4. testing/
  5. vendor/
  6. .bazelignore
  7. .bazelrc
  8. .gitignore
  9. BUILD.bazel
  10. cloudbuild.yaml
  11. CONTRIBUTING.md
  12. go.mod
  13. go.sum
  14. LICENSE
  15. MODULE.bazel
  16. postsubmit-cloudbuild.yaml
  17. README.md
  18. run_builds.sh
  19. run_unit_tests.sh
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.