Skip to content

Handle A/B images and refuse unread options - #1

Open
walterchris wants to merge 2 commits into
mainfrom
fix/ab-images
Open

walterchris wants to merge 2 commits into
mainfrom
fix/ab-images

Conversation

@walterchris

Copy link
Copy Markdown
Contributor
  • payload replace on images with a second RO CBFS (AMD PSP A/B recovery, Intel Top Swap): replaces the payload in COREBOOT and COREBOOT_B and updates both metadata hash anchors in BOOTBLOCK/BOOTBLOCK_B. Before, the edit guard refused these images.
  • payload list and show include COREBOOT_B.
  • option set/apply fail when the image's coreboot is built without CONFIG_USE_UEFI_VARIABLE_STORE, instead of writing a store nothing reads.

Tests: TestReplacePayloadAB, TestCommitOptionsNeedsBackend; unit, e2e and lint pass. Hardware: Sapphire RAVE2 (AMD Krackan, PSP A/B) boots an image with a replaced U-Boot payload, with CBFS verification on.

With AMD PSP A/B recovery or Intel Top Swap, coreboot builds the RO
CBFS twice (COREBOOT, COREBOOT_B) and keeps the metadata hash anchors in
the BOOTBLOCK and BOOTBLOCK_B regions. payload replace changed only
COREBOOT, and the edit guard rejected the anchor update in BOOTBLOCK, so
these images could not be changed at all.

Replace the payload in both CBFS copies, let the CBFS commands change
both copies and their BOOTBLOCK regions, and list COREBOOT_B in
payload list and show.

Tested on a Sapphire RAVE2 image (AMD Krackan, PSP A/B): both slots
carry the new payload, both metadata hashes are valid and the board
boots the new payload.

Signed-off-by: Christian Walter <christian.walter@9elements.com>
option set and apply wrote an EDK2 variable store into SMMSTORE even
when coreboot was built without CONFIG_USE_UEFI_VARIABLE_STORE, exited
0 and printed only a schema warning. Nothing reads that store, so the
values had no effect.

Fail instead when the image's build config is present and the option
backend is not set.

Signed-off-by: Christian Walter <christian.walter@9elements.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant