Revert "utility: Allow chromeos-tpm-recovery to return error."

This reverts commit dfcacc87be which breaks tpm2 systems where backup space is not yet defined.

Change-Id: I2e6e24ac24faaa980aa2dfaae2d801141fc49013
Reviewed-on: https://chromium-review.googlesource.com/413147
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
This commit is contained in:
Vadim Bendebury
2016-11-21 18:03:04 +00:00
committed by chrome-bot
parent 2a77e03895
commit dee2a61b9f

View File

@@ -14,7 +14,6 @@ crossystem=${USR_BIN}/crossystem
dot_recovery=${DOT_RECOVERY:=/mnt/stateful_partition/.recovery}
awk=/usr/bin/awk
initctl=/sbin/initctl
err=0
tpm2_target() {
# This is not an ideal way to tell if we are running on a tpm2 target, but
@@ -42,12 +41,6 @@ log_tryfix() {
log "$*: attempting to fix"
}
log_error() {
err=$((err + 1))
log "ERROR: $*"
}
tpm_clear_and_reenable () {
$tpmc clear
@@ -157,18 +150,13 @@ tpm_clear_and_reenable
# Reset firmware and kernel spaces to default (rollback version 1/1)
reset_space 0x1007 0x8001 0xa "02 00 01 00 01 00 00 00 00 4f" || \
log_error "could not fix firmware space"
log "could not fix firmware space"
reset_space 0x1008 0x1 0xd "02 4c 57 52 47 01 00 01 00 00 00 00 55" || \
log_error "could not fix kernel space"
log "could not fix kernel space"
# Don't need valid data in backup space, vboot can reset it as long as it exists
reset_space 0x1009 0x1 0x10 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" || \
log_error "could not fix backup space"
log "could not fix backup space"
restart_daemon_if_needed
if [ "$err" -eq 0 ]; then
log "TPM has successfully been reset to factory defaults"
else
log_error "TPM was not fully recovered."
exit 1
fi
log "TPM has successfully been reset to factory defaults"