From d9d1b8599e893b75a9f99d9c9f9979d8f7e0d036 Mon Sep 17 00:00:00 2001 From: Craig Hesling Date: Wed, 28 Apr 2021 18:27:29 -0700 Subject: 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 Change-Id: I2d14c5254d7159d63bf0e9bde5ba77e74670bfa2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2858277 Reviewed-by: Tom Hughes --- util/flash_fp_mcu | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'util') 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}" } -- cgit v1.2.1