termina_build_image: size image based on source

Rather than hard-coding a maximum 400 MB image size, which will need to
be adjusted later, use 120% the size of the source directory as a
starting point.  The image will still be shrunk to the minimum by
resize2fs before it is finalized.

This is equivalent to https://crrev.com/c/1544864 from the bash version
of this script, except that this uses 120% as the heuristic instead of
110%; 110% was failing for smaller images (resize2fs refuses to shrink
them and exits with an error).

BUG=chromium:999698
TEST=termina_build_image.py chromiumos_test_image.bin /tmp/termina

Change-Id: I6260f60686a4f122933c324f3ce95d062d18d7f5
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1779501
Tested-by: kokoro <noreply+kokoro@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
1 file changed
tree: 9adc1587f8bf8298e21f73ce8fd506a5d1d2305d
  1. cros-adapta/
  2. cros-apt-config/
  3. cros-garcon/
  4. cros-gpu/
  5. cros-gpu-alpha/
  6. cros-guest-tools/
  7. cros-notificationd/
  8. cros-pulse-config/
  9. cros-sftp/
  10. cros-sommelier/
  11. cros-sommelier-config/
  12. cros-sudo-config/
  13. cros-systemd-overrides/
  14. cros-tast-tests/
  15. cros-ui-config/
  16. cros-wayland/
  17. docs/
  18. kokoro/
  19. lxd/
  20. mesa/
  21. termina/
  22. .gitignore
  23. COMMIT-QUEUE.ini
  24. LICENSE
  25. OWNERS
  26. README.md
  27. WORKSPACE
README.md

cros-container-guest-tools

Overview

These are the guest packages for setting up a container to integrate with Chrome OS. This includes build scripts that are run in Google's internal continuous integration service.

Building

The guest packages can be built with Bazel. The CrOS milestone to target and release name (stretch, buster, etc.) are required.

bazel build //... --action_env="MILESTONE=74" --action_env="RELEASE=buster"