mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user