Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41988 )
Change subject: chromeos/cr50_enable_update.c: Modify recovery flow for cr50 ......................................................................
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 --- M src/vendorcode/google/chromeos/cr50_enable_update.c 1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/41988/1
diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c index 5b3a1a3..4351e7c 100644 --- a/src/vendorcode/google/chromeos/cr50_enable_update.c +++ b/src/vendorcode/google/chromeos/cr50_enable_update.c @@ -73,7 +73,8 @@ uint8_t num_restored_headers;
/* Nothing to do on recovery mode. */ - if (vboot_recovery_mode_enabled()) + if (vboot_recovery_mode_enabled() && + (vboot_get_context()->flags & VB2_CONTEXT_FORCE_RECOVERY_MODE)) return;
ret = tlcl_lib_init();
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41988 )
Change subject: chromeos/cr50_enable_update.c: Modify recovery flow for cr50 ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41988/1/src/vendorcode/google/chrom... File src/vendorcode/google/chromeos/cr50_enable_update.c:
https://review.coreboot.org/c/coreboot/+/41988/1/src/vendorcode/google/chrom... PS1, Line 77: (vboot_get_context()->flags & VB2_CONTEXT_FORCE_RECOVERY_MODE)) Can you please add a comment here explaining the reason behind doing this?
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41988 )
Change subject: chromeos/cr50_enable_update.c: Modify recovery flow for cr50 ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41988/1/src/vendorcode/google/chrom... File src/vendorcode/google/chromeos/cr50_enable_update.c:
https://review.coreboot.org/c/coreboot/+/41988/1/src/vendorcode/google/chrom... PS1, Line 76: vboot_recovery_mode_enabled nit: This check is redundant because the other one already implies this.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41988 )
Change subject: chromeos/cr50_enable_update.c: Modify recovery flow for cr50 ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/41988/1/src/vendorcode/google/chrom... File src/vendorcode/google/chromeos/cr50_enable_update.c:
https://review.coreboot.org/c/coreboot/+/41988/1/src/vendorcode/google/chrom... PS1, Line 76: vboot_recovery_mode_enabled
nit: This check is redundant because the other one already implies this.
Done
https://review.coreboot.org/c/coreboot/+/41988/1/src/vendorcode/google/chrom... PS1, Line 77: (vboot_get_context()->flags & VB2_CONTEXT_FORCE_RECOVERY_MODE))
Can you please add a comment here explaining the reason behind doing this?
Done
Hello Sam McNally, build bot (Jenkins), Furquan Shaikh, Julius Werner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/41988
to look at the new patch set (#2).
Change subject: chromeos/cr50_enable_update.c: Modify recovery flow for cr50 ......................................................................
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 --- M src/vendorcode/google/chromeos/cr50_enable_update.c 1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/41988/2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41988 )
Change subject: chromeos/cr50_enable_update.c: Modify recovery flow for cr50 ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41988/2/src/vendorcode/google/chrom... File src/vendorcode/google/chromeos/cr50_enable_update.c:
https://review.coreboot.org/c/coreboot/+/41988/2/src/vendorcode/google/chrom... PS2, Line 77: * spooled by recovery_reason := VB2_RECOVERY_TRAIN_AND_REBOOT. nit: This still doesn't really explain why it's checking for FORCE_RECOVERY. How about
/* Never update during manually-triggered recovery to ensure update cannot interfere. Non-manual VB2_RECOVERY_TRAIN_AND_REBOOT sometimes used to update in factory. */
Hello Sam McNally, build bot (Jenkins), Furquan Shaikh, Julius Werner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/41988
to look at the new patch set (#3).
Change subject: chromeos/cr50_enable_update.c: Modify recovery flow for cr50 ......................................................................
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 --- M src/vendorcode/google/chromeos/cr50_enable_update.c 1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/41988/3
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41988 )
Change subject: chromeos/cr50_enable_update.c: Modify recovery flow for cr50 ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41988/2/src/vendorcode/google/chrom... File src/vendorcode/google/chromeos/cr50_enable_update.c:
https://review.coreboot.org/c/coreboot/+/41988/2/src/vendorcode/google/chrom... PS2, Line 77: * spooled by recovery_reason := VB2_RECOVERY_TRAIN_AND_REBOOT.
nit: This still doesn't really explain why it's checking for FORCE_RECOVERY. How about […]
Done
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41988 )
Change subject: chromeos/cr50_enable_update.c: Modify recovery flow for cr50 ......................................................................
Patch Set 3: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/41988/3/src/vendorcode/google/chrom... File src/vendorcode/google/chromeos/cr50_enable_update.c:
https://review.coreboot.org/c/coreboot/+/41988/3/src/vendorcode/google/chrom... PS3, Line 75: * nit: There should be only one asterisk here, not two.
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/41988 )
Change subject: chromeos/cr50_enable_update.c: Modify recovery flow for cr50 ......................................................................
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 --- M src/vendorcode/google/chromeos/cr50_enable_update.c 1 file changed, 6 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c index 5b3a1a3..e30fe2a 100644 --- a/src/vendorcode/google/chromeos/cr50_enable_update.c +++ b/src/vendorcode/google/chromeos/cr50_enable_update.c @@ -72,8 +72,12 @@ 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();