summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2021-04-28 18:27:29 -0700
committerCommit Bot <commit-bot@chromium.org>2021-04-29 18:14:36 +0000
commitd9d1b8599e893b75a9f99d9c9f9979d8f7e0d036 (patch)
tree22bf9e1382f055e1d41bd4daeb0ee0f7c6a51810 /util
parent8d00c8ddf875d549aec338ce1f0f814f0b241d55 (diff)
downloadchrome-ec-d9d1b8599e893b75a9f99d9c9f9979d8f7e0d036.tar.gz
flash_fp_mcu: Truncate board name to base board name
This allows the script to work properly on derivative built targets, like hatch-arc-r and hatch-borealis. This is important for tast tests. BRANCH=none BUG=b:186697064 TEST=# dut1 is a dratini device scp util/flash_fp_mcu dut1:/usr/local/bin/flash_fp_mcu ssh dut1 flash_fp_mcu --hello; echo "Status $?" # Should succeed ssh dut1 flash_fp_mcu '/opt/google/biod/fw/bloonchipper*'; echo "Status $?" # Should succeed ssh dut1 flash_fp_mcu; echo "Status $?" # Should error out about no filename ssh dut1 touch /root/alreadyexists ssh dut1 flash_fp_mcu -r /root/alreadyexists; echo "Status $?" # Should fail citing that the output file already exists Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I2d14c5254d7159d63bf0e9bde5ba77e74670bfa2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2858277 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'util')
-rw-r--r--util/flash_fp_mcu6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu
index 27312bc093..0a75a1f5b2 100644
--- a/util/flash_fp_mcu
+++ b/util/flash_fp_mcu
@@ -168,6 +168,12 @@ get_platform_name() {
return 1
fi
+ # Tests are also run on modified images, like hatch-arc-r or hatch-borealis.
+ # These devices still have fingerprint and are expected to pass tests.
+ # See b/186697064.
+ # We remove any suffix starting at the first '-'.
+ platform_name="${platform_name%%-*}"
+
echo "${platform_name}"
}