diff options
author | Edward O'Callaghan <quasisec@google.com> | 2020-06-02 14:41:43 +1000 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-06-06 09:39:07 +0000 |
commit | 7c52283f7883f0a786c64f64b0ef2770d08dd91d (patch) | |
tree | 14387527988bb11ea381ba05c6010acf753e83b5 /src/vendorcode | |
parent | 5131c6f79a74b6f24720bab8322e9cd946e74807 (diff) | |
download | coreboot-7c52283f7883f0a786c64f64b0ef2770d08dd91d.tar.xz |
chromeos/cr50_enable_update.c: Modify recovery flow for cr50
Enable Cr50 update in recovery mode, so that we can at least still
update the process for most cases (that an update is pending in recovery
mode is not impossible but should be unlikely in the field).
Leave manual recovery unaffected so at least that would still work even
if Cr50 wedges in a weird way that it thinks it has an update on every
boot or something.
Setting the recovery_reason to VB2_RECOVERY_TRAIN_AND_REBOOT allows the
update to be applied.
BUG=b:154071064
BRANCH=none
TEST=builds
Thanks to Julius Werner for the suggested fix.
Change-Id: Iba341a750cce8334da4dcf6353ca8cd1268d170f
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41988
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/vendorcode')
-rw-r--r-- | src/vendorcode/google/chromeos/cr50_enable_update.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c index 5b3a1a3474..e30fe2a44c 100644 --- a/src/vendorcode/google/chromeos/cr50_enable_update.c +++ b/src/vendorcode/google/chromeos/cr50_enable_update.c @@ -72,8 +72,12 @@ static void enable_update(void *unused) int cr50_reset_reqd = 0; uint8_t num_restored_headers; - /* Nothing to do on recovery mode. */ - if (vboot_recovery_mode_enabled()) + /** + * Never update during manually-triggered recovery to ensure update + * cannot interfere. Non-manual VB2_RECOVERY_TRAIN_AND_REBOOT + * sometimes used to update in factory. + */ + if (vboot_get_context()->flags & VB2_CONTEXT_FORCE_RECOVERY_MODE) return; ret = tlcl_lib_init(); |