cos_kernel_args: fix bzimage packing

Use padding to ensure that the compressed bzImage payload doesn't change
size. It's important that the output bzImage is smaller than the input
bzImage in order for padding to work; we can guarantee this by making
the initial command line value as high entropy as possible (this will be
set in CONFIG_CMDLINE at kernel compile time). Also use the gzip tool
for compression/decompression, because the Go stdlib both doesn't fully
implement the gzip spec and inflates the size of the compressed data.

BUG=b/465210631

Change-Id: Ifbf700e76c144a3cef98c33596814ca5683f2631
Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/143583
Tested-by: Robert Kolchmeyer <rkolchmeyer@google.com>
Reviewed-by: He Gao <hegao@google.com>
Cloud-Build: GCB Service account <228075978874@cloudbuild.gserviceaccount.com>
3 files changed
tree: 57dadf680859ae2fc73623600921daad84a070d9
  1. coverage/
  2. release/
  3. src/
  4. testing/
  5. vendor/
  6. .bazelignore
  7. .gitignore
  8. BUILD.bazel
  9. cloudbuild.yaml
  10. CONTRIBUTING.md
  11. deps.bzl
  12. go.mod
  13. go.sum
  14. LICENSE
  15. postsubmit-cloudbuild.yaml
  16. README.md
  17. run_builds.sh
  18. run_unit_tests.sh
  19. 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.