From 516732f868a0c4bade1e718875b3779d3361c72f Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Fri, 29 Mar 2019 10:35:45 +0800 Subject: futility: updater: report flashrom error code When flashrom execution failed, it is not very easy to debug what went wrong especially when loading system active firmware (-r). The log may say SUCCEED (or no obvious error) and updater simply reports failure. Reporting the returned termination status should help. BUG=chromium:943262 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I4ea09b3d62ebf77eda98084accac582f841e7f7a Signed-off-by: Hung-Te Lin Reviewed-on: https://chromium-review.googlesource.com/1545590 Commit-Ready: ChromeOS CL Exonerator Bot Reviewed-by: Furquan Shaikh Reviewed-by: Edward O'Callaghan --- futility/updater.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/futility/updater.c b/futility/updater.c index c737f16f..d68a3cff 100644 --- a/futility/updater.c +++ b/futility/updater.c @@ -313,6 +313,8 @@ static int host_flashrom(enum flashrom_ops op, const char *image_path, if (op != FLASHROM_WP_STATUS) { r = system(command); free(command); + if (r) + ERROR("Error code: %d", r); return r; } -- cgit v1.2.1