From 952c2d32452fc582900cc542edd75c7da6b3f830 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 26 Jun 2013 15:20:44 -0700 Subject: 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 Signed-off-by: Shawn Nematbakhsh Change-Id: I3b311416bf8c504deb4154e5850d967253c9dc17 Reviewed-on: https://gerrit.chromium.org/gerrit/60148 Reviewed-by: Aaron Durbin Commit-Queue: Shawn Nematbakhsh Tested-by: Shawn Nematbakhsh --- firmware/lib/vboot_firmware.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- cgit v1.2.1