diff options
author | Hung-Te Lin <hungte@chromium.org> | 2020-09-25 11:11:22 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-26 09:18:33 +0000 |
commit | 524012c64c07f8673998428cca7f80e01a387f48 (patch) | |
tree | d011d454951af2d6dbcf7d4dc7af53a31cc883db | |
parent | 98ab5ea45d8eaa194e52f0347fc19f767663f8c1 (diff) | |
download | vboot-524012c64c07f8673998428cca7f80e01a387f48.tar.gz |
futility: updater: print flashrom execution logs on read failurestabilize-13505.1.B
To prevent flooding AU logs, we don't want flashrom to print verbose
logs especially when reading system SPI flash. However, if anything goes
wrong it will be very helpful to have all the messages logged.
With this patch, we will try reading system flash again with max verbosity.
BUG=chromium:943262,b:169026171
TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility
BRANCH=None
Change-Id: I5469182f2628855e65546bef3abf8791261aabca
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1545598
Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
-rw-r--r-- | futility/updater_utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/futility/updater_utils.c b/futility/updater_utils.c index 5a2a5e6d..a441e03d 100644 --- a/futility/updater_utils.c +++ b/futility/updater_utils.c @@ -639,6 +639,17 @@ int load_system_firmware(struct firmware_image *image, r = host_flashrom(FLASHROM_READ, tmp_path, image->programmer, verbosity, NULL, NULL); + /* + * The verbosity for host_flashrom will be translated to + * (verbosity-1)*'-V', and usually 3*'-V' is enough for debugging. + */ + const int debug_verbosity = 4; + if (r && verbosity < debug_verbosity) { + /* Read again, with verbose messages for debugging. */ + WARN("Failed reading system firmware (%d), try again...\n", r); + r = host_flashrom(FLASHROM_READ, tmp_path, image->programmer, + debug_verbosity, NULL, NULL); + } if (!r) r = load_firmware_image(image, tmp_path, NULL); return r; |