summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2018-11-27 10:16:36 +0800
committerFurquan Shaikh <furquan@chromium.org>2018-11-30 16:00:45 +0000
commit36fb82c7cba832008152dc33429af30f39d5d3dd (patch)
treefad0dfa29fdadfbf02ef29cc360365aeec3c78f8
parent0b3fbec00c95453de3de1747f5cb78d3f951c7a1 (diff)
downloadvboot-36fb82c7cba832008152dc33429af30f39d5d3dd.tar.gz
futility: updater: Revise error message when model is not defined in manifest
"Model '%s' is not defined in manifest." is not very easy to understand for people who are debugging devices in early stages. We should provide better instructions. For example, running with Coral updater will now show: ERROR: manifest_find_model: Cannot get model name. You are probably running an image for wrong board, or a device in early stage that 'mosys' command is not ready, or image from old (or factory) branches that Unified Build config is not updated yet for 'mosys'. Please check command 'mosys platform model', which should output one of the supported models below: unprovisioned_meep sparky orbatrix unprovisioned_fleex grabbiter bobba unprovisioned_bobba mimrock fleex meep yorp phaser360 sparky360 phaser bobba360 unprovisioned_phaser bip BUG=chromium:875551 TEST=TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: Ib17fcb654d1530b94c44cf21aaa28717841f11ed Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1351171 Reviewed-by: Cheng-Han Yang <chenghan@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/1355750 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
-rw-r--r--futility/updater_archive.c22
-rwxr-xr-xtests/futility/test_update.sh2
2 files changed, 21 insertions, 3 deletions
diff --git a/futility/updater_archive.c b/futility/updater_archive.c
index 9a1bb059..0a3ed502 100644
--- a/futility/updater_archive.c
+++ b/futility/updater_archive.c
@@ -813,8 +813,26 @@ const struct model_config *manifest_find_model(const struct manifest *manifest,
if (strcmp(model_name, manifest->models[i].name) == 0)
model = &manifest->models[i];
}
- if (!model)
- ERROR("Model '%s' is not defined in manifest.", model_name);
+ if (!model) {
+ if (!*model_name)
+ ERROR("Cannot get model name.");
+ else
+ ERROR("Unsupported model: '%s'.", model_name);
+
+ fprintf(stderr,
+ "You are probably running an image for wrong board, or "
+ "a device in early stage that 'mosys' command is not "
+ "ready, or image from old (or factory) branches that "
+ "Unified Build config is not updated yet for 'mosys'.\n"
+ "Please check command 'mosys platform model', "
+ "which should output one of the supported models below:"
+ "\n");
+
+ for (i = 0; i < manifest->num; i++)
+ fprintf(stderr, " %s", manifest->models[i].name);
+ fprintf(stderr, "\n");
+ }
+
free(sys_model_name);
return model;
diff --git a/tests/futility/test_update.sh b/tests/futility/test_update.sh
index 294517d7..03743f97 100755
--- a/tests/futility/test_update.sh
+++ b/tests/futility/test_update.sh
@@ -378,7 +378,7 @@ test_update "Full update (--archive, model=peppy)" \
"${FROM_IMAGE}.ap" "${PEPPY_BIOS}" \
-a "${A}" --wp=0 --sys_props 0,0x10001,1,3 --model=peppy
test_update "Full update (--archive, model=unknown)" \
- "${FROM_IMAGE}.ap" "!Model 'unknown' is not defined" \
+ "${FROM_IMAGE}.ap" "!Unsupported model: 'unknown'" \
-a "${A}" --wp=0 --sys_props 0,0x10001,1,3 --model=unknown
test_update "Full update (--archive, model=whitetip, signature_id=WL)" \
"${FROM_IMAGE}.al" "${LINK_BIOS}" \