summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2011-07-19 15:52:43 -0700
committerRandall Spangler <rspangler@chromium.org>2011-07-20 16:25:57 -0700
commitad33485a2fc87ccd8859f955601ecfd38fa4402c (patch)
tree5402585186e12630a1d7aa26638229f1f18e1a6b
parent43101b4b50f4709acd010e85acba4f79d7005d7e (diff)
downloadvboot-ad33485a2fc87ccd8859f955601ecfd38fa4402c.tar.gz
Clear the recovery request after each boot attempt which is allowed to fail
The problem is that the recovery request was only being cleared when the firmware found a good image, not after a failed attempt was ignored. BUG=chromium-os:17846 TEST=see bug for manual test procedure Change-Id: I4c6b026bef477839def9bf2b0fed626a9922650f Reviewed-on: http://gerrit.chromium.org/gerrit/4352 Reviewed-by: Stefan Reinauer <reinauer@google.com> Tested-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--firmware/lib/vboot_api_kernel.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index ea184a53..03ea1886 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -478,6 +478,10 @@ VbError_t VbBootDeveloper(VbCommonParams* cparams, LoadKernelParams* p) {
} else {
VBDEBUG(("VbBootDeveloper() - no kernel found on USB\n"));
VbExBeep(DEV_DELAY_INCREMENT, 400);
+ /* Clear recovery requests from failed kernel loading, so
+ * that powering off at this point doesn't put us into
+ * recovery mode. */
+ VbSetRecoveryRequest(VBNV_RECOVERY_NOT_REQUESTED);
}
break;
default:
@@ -543,6 +547,11 @@ VbError_t VbBootRecovery(VbCommonParams* cparams, LoadKernelParams* p) {
VBDEBUG(("VbBootRecovery() attempting to load kernel\n"));
retval = VbTryLoadKernel(cparams, p, VB_DISK_FLAG_REMOVABLE);
+ /* Clear recovery requests from failed kernel loading, since we're
+ * already in recovery mode. Do this now, so that powering off after
+ * inserting an invalid disk doesn't leave us stuck in recovery mode. */
+ VbSetRecoveryRequest(VBNV_RECOVERY_NOT_REQUESTED);
+
if (VBERROR_SUCCESS == retval)
break; /* Found a recovery kernel */
else if (VBERROR_TRY_LOAD_REBOOT == retval)
@@ -642,10 +651,6 @@ VbError_t VbSelectAndLoadKernel(VbCommonParams* cparams,
kparams->bootloader_size = (uint32_t)p.bootloader_size;
Memcpy(kparams->partition_guid, p.partition_guid,
sizeof(kparams->partition_guid));
-
- /* Since we did find something to boot, clear recovery request, if any,
- * resulting from disk checks during developer or recovery mode. */
- VbSetRecoveryRequest(VBNV_RECOVERY_NOT_REQUESTED);
}
if (vnc.raw_changed)