Support "fastboot oem gbl-sync-gpt <blk_idx>"
Adds support for manually re-syncing GPT via fastboot oem command.
Synced partition takes effect immediately. This allows users to update
gpt using the following commands:
fastboot flash /<blk_idx> gpt.bin
fastboot oem gbl-sync-gpt <blk_idx>
Originating PR: https://android-review.googlesource.com/c/platform/bootable/libbootloader/+/3319013
Cherry-pick notes: Rebased onto gbl-mainline GblDisk, GptSyncResult,
and FromHexStr APIs (partition.rs and vars.rs interior-mutability
changes landed separately); drains pending async I/O tasks before
syncing GPT, gates raw `flash:/0` in test_oem_sync_gpt on `gbl_dev`,
and fixes Responder::send_buffer's off-by-one `<` bound so full
256-byte GptError FAIL replies truncate cleanly at a UTF-8 boundary
instead of panicking.
Bug: 374792430
Bug: 376407624
Bug: 529666741
Test: tools/bazel test --config=gbl @gbl//tests //bootable/libbootloader:gbl_efi_dist
Flag: EXEMPT BUGFIX
Change-Id: I40120c8ef7106c626da1e85a6de28bd18a36f6ff
3 files changed