summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2023-03-02 02:19:21 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-29 08:19:45 +0000
commitb087e8ecda56f1b421f687e1ca6a76545d539c0e (patch)
treef04ab949b7b1a704235bb9234ff4fbe2eb37a56b
parentf91f493825921d1aa5b73899824f9da6396a736f (diff)
downloadvboot-b087e8ecda56f1b421f687e1ca6a76545d539c0e.tar.gz
futility: updater: revise DUT type detection
Some commands like 'cros ap flash' may pass '-p host' to the futility updater, making the updater consider itself running in the remote DUT mode. Other futility commands sharing the flash arguments (e.g., handle_flash_argument) work on files by default and only do flashing if '-p' is specified, but that is not the case for the updater. So we should double check the programmer before deciding the DUT type. BUG=b:271115449 TEST=FEATURES=test emerge vboot_reference BRANCH=None Change-Id: I5be6e4382acffced0ef9cd94f6ede9e9d3fe2efa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4300000 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4381001 Auto-Submit: Phoebe Wang <phoebewang@chromium.org> Commit-Queue: Cheng Yueh <cyueh@chromium.org> Tested-by: Phoebe Wang <phoebewang@chromium.org> Reviewed-by: Cheng Yueh <cyueh@chromium.org>
-rw-r--r--futility/updater.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/futility/updater.c b/futility/updater.c
index b08e70ad..362d5dfc 100644
--- a/futility/updater.c
+++ b/futility/updater.c
@@ -1437,11 +1437,6 @@ int updater_setup_config(struct updater_config *cfg,
if (arg->force_update)
cfg->force_update = 1;
- /* Identify DUT type. Currently only local/remote (via servo). */
- cfg->dut_is_remote = arg->use_flash;
- if (cfg->dut_is_remote)
- INFO("Configured to update a remote DUT via Servo.\n");
-
/* Check incompatible options and return early. */
if (arg->do_manifest) {
if (!!arg->archive == !!arg->image) {
@@ -1504,8 +1499,12 @@ int updater_setup_config(struct updater_config *cfg,
cfg->override_gbb_flags = arg->override_gbb_flags;
/* Setup properties and fields that do not have external dependency. */
- if (arg->programmer) {
+ if (arg->programmer && strcmp(arg->programmer, cfg->image.programmer)) {
check_single_image = 1;
+ /* DUT should be remote if the programmer is changed. */
+ cfg->dut_is_remote = 1;
+ INFO("Configured to update a remote DUT%s.\n",
+ arg->detect_servo ? " via Servo" : "");
cfg->image.programmer = arg->programmer;
cfg->image_current.programmer = arg->programmer;
cfg->original_programmer = arg->programmer;