utility: Allow chromeos-tpm-recovery to return failure.
When some of the space re-creation procedure failed, chromeos-tpm-recovery
should exit with non-zero value and not saying TPM is successfully recovered.
However, there are few known issues:
- 0x1009 is not needed in TPM2.
- The space is not created in TPM2.
- tlcl does not support define spaces with policies yet (crosbug.com/p/59594).
As a result, we want to return failure only if writing any of the two
spaces (0x1007, 0x1008) fails.
This change also revised chromeos-tpm-recovery so it won't exit with unbound
variable error due to early exit without having daemon_was_running variable.
TEST=For boards with TPM and TPM2, do:
build_image --board $BOARD factory_install;
Boot factory install shim, select 'I' and get TPM recovered.
Signed-off-by: Hung-Te Lin <email@example.com>
Reviewed-by: Vadim Bendebury <firstname.lastname@example.org>
(cherry picked from commit c66cbc3440b03440d591274b188ea62b2de7af80)
1 file changed