Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/64880 )
Change subject: util/cbfstool/elogtool.c: Convert args into struct in flashrom helper ......................................................................
util/cbfstool/elogtool.c: Convert args into struct in flashrom helper
vboot signatures for flashrom r/w helpers changed in the upstream commit bd2971326ee94fc5. Reflect the change here to allow vboot ref and coreboot to realign.
BUG=b:207808292,b:231152447 BRANCH=none TEST=builds with vboot_ref uprev.
Change-Id: Ie7e75065a76dc8523a2dfe8171e1c0dd1be7fa7e Signed-off-by: Edward O'Callaghan quasisec@google.com --- M util/cbfstool/elogtool.c 1 file changed, 13 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/64880/1
diff --git a/util/cbfstool/elogtool.c b/util/cbfstool/elogtool.c index 253e2ee..164c1d1 100644 --- a/util/cbfstool/elogtool.c +++ b/util/cbfstool/elogtool.c @@ -78,16 +78,16 @@ */ static int elog_read(struct buffer *buffer, const char *filename) { - if (filename == NULL) { - uint8_t *buf; - uint32_t buf_size; + struct firmware_image image = { + .programmer = FLASHROM_PROGRAMMER_INTERNAL_AP, + };
- if (flashrom_read(FLASHROM_PROGRAMMER_INTERNAL_AP, ELOG_RW_REGION_NAME, - &buf, &buf_size) != VB2_SUCCESS) { + if (filename == NULL) { + if (flashrom_read(&image, ELOG_RW_REGION_NAME) != VB2_SUCCESS) { fprintf(stderr, "Could not read RW_ELOG region using flashrom\n"); return ELOGTOOL_EXIT_READ_ERROR; } - buffer_init(buffer, NULL, buf, buf_size); + buffer_init(buffer, NULL, image.data, image.size); } else if (buffer_from_file(buffer, filename) != 0) { fprintf(stderr, "Could not read input file: %s\n", filename); return ELOGTOOL_EXIT_READ_ERROR; @@ -108,9 +108,14 @@ */ static int elog_write(struct buffer *buf, const char *filename) { + struct firmware_image image = { + .programmer = FLASHROM_PROGRAMMER_INTERNAL_AP, + .data = buffer_get(buf), + .size = buffer_size(buf), + }; + if (filename == NULL) { - if (flashrom_write(FLASHROM_PROGRAMMER_INTERNAL_AP, ELOG_RW_REGION_NAME, - buffer_get(buf), buffer_size(buf)) != VB2_SUCCESS) { + if (flashrom_write(&image, ELOG_RW_REGION_NAME) != VB2_SUCCESS) { fprintf(stderr, "Failed to write to RW_ELOG region using flashrom\n"); return ELOGTOOL_EXIT_WRITE_ERROR;