mod_image_for_recovery: Generalize partition hash calculation

The `calculate_kernel_hash` function has been renamed to
`calculate_partition_hash` and refactored to accept a partition number
as an argument, making it reusable for hashing any partition. The
temporary file cleanup is also improved.

BUG=b:426664945
TEST=Builders/CQ

Change-Id: I18a220be5269f52545d68fedac6987c1d2713923
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/6833627
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
1 file changed
tree: d4eebb9f1e25750033471b430cfdcf2a3e5f3a03
  1. bin/
  2. build_library/
  3. hooks/
  4. lib/
  5. mod_for_test_scripts/
  6. .gitignore
  7. build_kernel_image.sh
  8. common.sh
  9. cros_show_stacks
  10. DIR_METADATA
  11. image_to_vm.sh
  12. make_netboot.sh
  13. mod_image_for_recovery.sh
  14. mount_gpt_image.sh
  15. OWNERS
  16. PRESUBMIT.cfg
  17. README.md
  18. update_bootloaders.sh
  19. update_kernel.sh
README.md

src/scripts directory

This repository contains build tools and scripts written in shell (e.g., Bash). Historically, much of our build process was written in shell in this directory, however, we're currently in the process of migrating many scripts to Python in Chromite.

In general, we're not currently accepting new scripts in this directory.

If you want to host a script for yourself/local team, feel free to use the src/platform/dev/contrib/ directory instead.