zip-img 519 B

1234567891011121314
  1. #!/usr/bin/env bash
  2. set -eu
  3. # Ideally should be obtained from common.
  4. # But the paths there are absolute, and get recorded by in zip.
  5. # and generating relative paths seems hard:
  6. # https://stackoverflow.com/questions/2564634/convert-absolute-path-into-relative-path-given-a-current-directory-using-bash
  7. outfile="out/images-$(git log -1 --format="%H").zip"
  8. rm -f "$outfile"
  9. for arch in x86_64 arm aarch64; do
  10. img_dir="out/${arch}/buildroot/images"
  11. rm -f "${img_dir}/rootfs.ext2"
  12. zip -r "$outfile" "${img_dir}"
  13. done