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>
This commit is contained in:
Randall Spangler
2011-07-19 15:52:43 -07:00
parent 43101b4b50
commit ad33485a2f

View File

@@ -478,6 +478,10 @@ VbError_t VbBootDeveloper(VbCommonParams* cparams, LoadKernelParams* p) {
} else { } else {
VBDEBUG(("VbBootDeveloper() - no kernel found on USB\n")); VBDEBUG(("VbBootDeveloper() - no kernel found on USB\n"));
VbExBeep(DEV_DELAY_INCREMENT, 400); 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; break;
default: default:
@@ -543,6 +547,11 @@ VbError_t VbBootRecovery(VbCommonParams* cparams, LoadKernelParams* p) {
VBDEBUG(("VbBootRecovery() attempting to load kernel\n")); VBDEBUG(("VbBootRecovery() attempting to load kernel\n"));
retval = VbTryLoadKernel(cparams, p, VB_DISK_FLAG_REMOVABLE); 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) if (VBERROR_SUCCESS == retval)
break; /* Found a recovery kernel */ break; /* Found a recovery kernel */
else if (VBERROR_TRY_LOAD_REBOOT == retval) else if (VBERROR_TRY_LOAD_REBOOT == retval)
@@ -642,10 +651,6 @@ VbError_t VbSelectAndLoadKernel(VbCommonParams* cparams,
kparams->bootloader_size = (uint32_t)p.bootloader_size; kparams->bootloader_size = (uint32_t)p.bootloader_size;
Memcpy(kparams->partition_guid, p.partition_guid, Memcpy(kparams->partition_guid, p.partition_guid,
sizeof(kparams->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) if (vnc.raw_changed)