futility: Add firmware updater as 'futility update'

The factory branches may need to run firmware updater extracted from
newer release images which relies on 'futility update' to run.
This change collects all related changes:

85974d01 futility: Add 'Error' utility macro
eee33827 futility: Add 'update' command for updating firmware
22266d1f futility: cmd_update: Support loading image files by -i, -e, --pd_image
6d30a78a futility: cmd_update: Process FMAP and parse image version
035f0da2 futility: cmd_update: Access system firmware using external flashrom
039ad74d futility: cmd_update: Add '--emulate' option
e04be109 futility: cmd_update: Implement updater logic "FULL UPDATE".
0a368cac futility: cmd_update: Add "system property" and '--sys_props' to override
8017381e futility: cmd_update: Implement updater logic "RW UPDATE".
b77e2548 futility: cmd_update: Add 'mainfw_act' system property
6b1ead30 futility: cmd_update: Implement updater logic "TRY-RW" (--try)
eb0c9caf futility: cmd_update: Preserve image sections before update
9f27a900 futility: cmd_update: Check contents before starting to update
e25ffef4 futility: cmd_update: Use real system write protection status
f7b99d00 futility: cmd_update: Add vboot1 updater logic
b0f5a8f9 futility: cmd_update: Check platform compatibility before updating
c13d39fa futility: cmd_update: Check TPM key versions before updating
ede6a006 futility: cmd_update: Check RO and RW signing compatibility before updating
8b86ee5d futility: cmd_update: Add more legacy updater options
6a867bc4 futility: cmd_update: Correct updating logic for RW_LEGACY
27fc2478 futility: cmd_update: Preserve sections blocked by management engine
35c99021 futility: cmd_update: Revise debug and error message macro
b5a4e47c futility: cmd_update: Correctly handle error counter
50cf198c futility: cmd_update: Add new 'legacy' mode
da4e823f futility: cmd_update: Create and remove temporary files properly
1bb66a0c futility: cmd_update: Add --quirks for device-specific hacks
b4243c6b futility: cmd_update: Add quirk 'enlarge_image'
c3c9ae6a futility: cmd_update: Add quirk 'unlock_me_for_update'
382375b3 futility: cmd_update: Add quirk 'min_platform_version'
cabd2f8c futility: update: Fix update failure in factory mode due to wrong WP logic
ac8cb8dd futility: update: Add legacy option '--factory'
d6f7c16b futility: update: Skip TPM check if tpm_fwver is not valid.
f6198074 futility: update: Preserve new sections: RO_PRESERVE and RW_PRESERVE
f67b991a futility: update: Preserve RO_FSG
ee96e741 futility: update: Preserve RW_ELOG
b07165b5 futility: update: Allow tpm_fwver=0 and allow --force to waive TPM check
5a5be0c7 futility: update: Revise error messages
ba73f35e futility: update: Refactor 'emulation' (--emulate).
eb166257 futility: update: Add --programmer to override flashrom programmer for servo
5fa5e3b9 futility: update: Refactor: move updater logic to 'updater.c'
243e2115 futility: updater: Refactor: move command line processing to cmd_update.c
e7bcda54 futility: updater: Refactor: localize temp files management
8810b089 futility: updater: Refactor: move quirks to 'updater_quirks.c'
a1bfb650 futility: updater: Add default quirks
a2b9e356 futility: updater: Add quirk 'daisy_snow_dual_model' for daisy_snow
ba30c93b futility: updater: Preserve SMMSTORE and add quirk 'eve_smm_store'
38d06701 futility: updater: Support reading main image from stdin
f1609b8c futility: updater: Revise verbosity and error messages
fabf760f futility: updater: Add ASPRINTF macro
7aa34302 futility: updater: Refactor function names
077026fd futility: updater: Add '--archive' to read from an archive or directory
f7c44a32 futility: updater: Refactor how arguments were configured
1847ba4f futility: updater: Add --manifest to scan and print archive info
a71e0ccd futility: updater: Allow patching rootkey and vblock files
2ae23df7 futility: updater: Change default model name to FWID platform name
3d615c91 futility: updater: Do not preserve GBB flags in --factory mode.
10b3d4ed futility: updater: Add '--model' and select images by system model
622c35aa futility: updater: Support white label from VPD and --signature_id
c6781206 futility: updater: Support --mode=output and --output_dir
fb947ae0 futility: update: Add `--host_only` argument
67d66f18 futility: updater: Support --repack and --unpack
1f489393 futility: updater: Fix model detection error

BUG=chromium:882445
TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility
BRANCH=None

Change-Id: I6c14133f59561a422a190b17fa8ff7e79c45d953
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1348510
13 files changed