Add support for FEC in hashtrees.

This change adds support for 'avbtool add_hashtree_footer' options
--generate_fec and --fec_num_roots. If used, this generates FEC data on
the given image. If used on the root filesystem, the kernel command-line
will be set up to use it. For more information about FEC, see

 https://gitlab.com/cryptsetup/cryptsetup/wikis/DMVerity

By default this feature is not turned on. It can be enabled for the root
filesystem by adding this line

 BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS := --generate_fec

to the build system files.

Note that this change extends the AvbHashtreeDescriptor struct to carry
FEC-related metadata. This change would normally be a no-no (since we're
changing metadata stored on disk!) but since AVB isn't yet used in
device firmware - or even undergone a release (see Issue 32414650) -
this change is considered to be OK.

Test: New unit tests + unit tests pass.
Test: Manually tested in qemu using an UEFI-based bootloader.
Bug: 31263832
Change-Id: I271956112c0fe52f57e3a66c0d0658e6b5266239
6 files changed
tree: 5aba8c7be8b3216ae58512f2a98d426a16b01aa3
  1. boot_control/
  2. libavb/
  3. test/
  4. Android.mk
  5. avbtool
  6. LICENSE
  7. README