diff options
author | Julius Werner <jwerner@chromium.org> | 2020-12-03 12:41:00 -0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2020-12-04 22:35:40 +0000 |
commit | 0247fcf87b8574b8b9ecd1f49d5b7f4087384c83 (patch) | |
tree | 948da66adc57b644a70eddcb8408398e03e2aee5 | |
parent | 88d8e2b74eb9b2b3186ccb519efd1dbd92a090cb (diff) |
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
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48278
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
-rw-r--r-- | src/lib/cbfs.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 5df1d8bd85..d27550576a 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -52,8 +52,17 @@ cb_err_t cbfs_boot_lookup(const char *name, bool force_ro, 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) + printk(BIOS_ERR, "CBFS 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; |