summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-06-26 15:20:44 -0700
committerChromeBot <chrome-bot@google.com>2013-06-26 17:44:44 -0700
commit952c2d32452fc582900cc542edd75c7da6b3f830 (patch)
tree78ca7508f5a7f4fcdffdbacbf17ee08459e03263
parent1c568bccc442afd91ea7ee5367668ba9ebc06a40 (diff)
downloadvboot-952c2d32452fc582900cc542edd75c7da6b3f830.tar.gz
Fix recovery mode entry due to invalid FW hash.
If FW hash is invalid, it is possible for boot to continue as normal because the shared recovery reason is not updated. Update the shared recovery reason to ensure the bootloader knows to do a recovery boot. This change affects only systems that do not support RO_NORMAL (ex. Haswell systems). BUG=chrome-os-partner:20518. TEST=Run firmware_CorruptBothFwSigAB on Peppy, verify PASS. BRANCH=None. Signed-off-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I3b311416bf8c504deb4154e5850d967253c9dc17 Reviewed-on: https://gerrit.chromium.org/gerrit/60148 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org> Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
-rw-r--r--firmware/lib/vboot_firmware.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/lib/vboot_firmware.c b/firmware/lib/vboot_firmware.c
index 8d165f2a..d909e9fc 100644
--- a/firmware/lib/vboot_firmware.c
+++ b/firmware/lib/vboot_firmware.c
@@ -346,6 +346,13 @@ int LoadFirmware(VbCommonParams *cparams, VbSelectFirmwareParams *fparams,
/* Store recovery request, if any */
VbNvSet(vnc, VBNV_RECOVERY_REQUEST, VBERROR_SUCCESS != retval ?
recovery : VBNV_RECOVERY_NOT_REQUESTED);
+ /* If the system does not support RO_NORMAL and LoadFirmware()
+ * encountered an error, update the shared recovery reason if
+ * recovery was not previously requested. */
+ if (!(shared->flags & VBSD_BOOT_RO_NORMAL_SUPPORT) &&
+ VBNV_RECOVERY_NOT_REQUESTED == shared->recovery_reason &&
+ VBERROR_SUCCESS != retval)
+ shared->recovery_reason = recovery;
return retval;
}