Patrick Rudolph would like Patrick Rudolph to review this change.

View Change

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>
---
M cli_classic.c
1 file changed, 10 insertions(+), 4 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/45/33245/1
diff --git a/cli_classic.c b/cli_classic.c
index ced08c6..f6bd59b 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -607,10 +607,16 @@

if (layoutfile) {
layout = get_global_layout();
- } else if (ifd && (flashrom_layout_read_from_ifd(&layout, fill_flash, NULL, 0) ||
- process_include_args(layout))) {
- ret = 1;
- goto out_shutdown;
+ } else if (ifd) {
+ ret = flashrom_layout_read_from_ifd(&layout, fill_flash, NULL, 0);
+ if (ret) {
+ msg_gerr("Failed to read or parse the IFD\n");
+ ret = 1;
+ goto out_shutdown;
+ } else if (process_include_args(layout)) {
+ ret = 1;
+ goto out_shutdown;
+ }
} else if (fmap && fmapfile) {
struct stat s;
if (stat(fmapfile, &s) != 0) {

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: 1
Gerrit-Owner: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-MessageType: newchange