Hello Furquan Shaikh, Patrick Georgi,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/48278
to review the following change.
Change subject: cbfs: Add more error messages for lookup ......................................................................
cbfs: Add more error messages for lookup
The new CBFS stack will log messages for found files but leaves error messages up to the caller. This patch adds appropriate generic error messages to cbfs_lookup(), matching the behavior of the old CBFS stack for not found files.
Signed-off-by: Julius Werner jwerner@chromium.org Change-Id: I8cf44026accc03c466105d06683027caf1693ff0 --- M src/lib/cbfs.c 1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/48278/1
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 5df1d8b..d66c5d6 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -52,8 +52,17 @@ name); return cbfs_boot_lookup(name, true, mdata, rdev); } - if (err) + if (err) { + if (err == CB_CBFS_NOT_FOUND) + printk(BIOS_WARNING, "CBFS: '%s' not found.\n", name); + else if (err == CB_CBFS_HASH_MISMATCH) + die("CBFS FATAL ERROR: metadata hash mismatch!\n"); + else + printk(BIOS_ERR, + "CBFS ERROR: error %d when looking up '%s'\n", + err, name); return err; + }
if (rdev_chain(rdev, &cbd->rdev, data_offset, be32toh(mdata->h.len))) return CB_ERR;