Hello Patrick Rudolph,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/flashrom/+/33245
to review the following change.
Change subject: cli: Add error on missing IFD ......................................................................
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) {