libavb: Make it possible to store A/B metadata somewhere else than 'misc'.

For multi-stage bootloaders it might be desirable for the early stage to
store A/B metadata in e.g. NVRAM rather than on disk.

Allow this by introducing read_ab_metadata() and write_ab_metadata()
operations in AvbOps and use these instead of avb_ab_data_read() and
avb_ab_data_write().

Make a note in the AvbOps docs that avb_ab_data_read() and
avb_ab_data_write() can be used directly.

Bug: None
Test: New unit tests and unit tests pass.
Test: Tested in UEFI-based bootloader in qemu.
Change-Id: I0e32e387de8f9239de1c035e1c0db03e43a66115
5 files changed
tree: 830c087f5634852c6b6190ce887b82ec68644d2e
  1. boot_control/
  2. libavb/
  3. test/
  4. Android.mk
  5. avbtool
  6. LICENSE
  7. README