build_library: write partition variables to a json file

Moving chromeos_startup to cpp and we still need access to the
partition variables loaded by write_gpt.sh. Generating a json
file to contain these variables will allow us to access them
from the cpp files.

BUG=chromium:1048728
TEST=build_image --board=hatch, json file exists on device
Checked /usr/sbin/write_gpt.sh sections load_base_vars()
and load_partition_vars() are correct

Change-Id: I39fee5be7b183a186680ade94062d8ee43c41e7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/2371199
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Commit-Queue: Alexis Savery <asavery@chromium.org>
Tested-by: Alexis Savery <asavery@chromium.org>
2 files changed