Nico Huber merged this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
cli: Add error on missing IFD

When no IFD is present, but the option --ifd is specified, flashrom would just
exit without printing a helpful error message.

Add error message that IFD could not be read or parsed.

Tested on Intel platform without IFD present.

Change-Id: Ie1edd7f36f647c52b17799878185d1e69e10d3b0
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/33245
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
---
M libflashrom.c
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/libflashrom.c b/libflashrom.c
index f90a22c..c5e56ae 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -353,18 +353,21 @@
msg_cinfo("done.\n");

if (layout_from_ich_descriptors(chip_layout, desc, 0x1000)) {
+ msg_cerr("Couldn't parse the descriptor!\n");
ret = 3;
goto _finalize_ret;
}

if (dump) {
if (layout_from_ich_descriptors(&dump_layout, dump, len)) {
+ msg_cerr("Couldn't parse the descriptor!\n");
ret = 4;
goto _finalize_ret;
}

if (chip_layout->base.num_entries != dump_layout.base.num_entries ||
memcmp(chip_layout->entries, dump_layout.entries, sizeof(dump_layout.entries))) {
+ msg_cerr("Descriptors don't match!\n");
ret = 5;
goto _finalize_ret;
}

To view, visit change 33245. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ie1edd7f36f647c52b17799878185d1e69e10d3b0
Gerrit-Change-Number: 33245
Gerrit-PatchSet: 6
Gerrit-Owner: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: merged