diff options
author | Tom Hughes <tomhughes@chromium.org> | 2020-05-21 09:31:49 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-21 22:03:05 +0000 |
commit | 333549dbda3f068cf67d2f7600feb02cdef383a2 (patch) | |
tree | 01524e45e59164f2c4f68a86e39b110c6cce211f /util/flash_fp_mcu | |
parent | aac0c25ef5cc7cb6758dc9ed650fab4995c58fcd (diff) | |
download | chrome-ec-333549dbda3f068cf67d2f7600feb02cdef383a2.tar.gz |
util: Fix platform name in flash_fp_mcu
cros_config /identity platform-name is specific to mosys and not
guaranteed to be the same as the board name.
Always use CHROMEOS_RELEASE_BOARD from /etc/lsb-release instead.
BRANCH=none
BUG=b:156650654
TEST=On ekko:
flash_fp_mcu /opt/google/biod/fw/nami*.bin
TEST=On kohaku:
flash_fp_mcu /opt/google/biod/fw/dartmonkey*.bin
TEST=On nocturne:
flash_fp_mcu /opt/google/biod/fw/nocturne*.bin
TEST=On dratini:
flash_fp_mcu /opt/google/biod/fw/bloonchipper*.bin
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ic395e1c6bfdd5c9d4e397a50e594c03d2cf91af1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2212689
Commit-Queue: Yicheng Li <yichengli@chromium.org>
Reviewed-by: Yicheng Li <yichengli@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'util/flash_fp_mcu')
-rw-r--r-- | util/flash_fp_mcu | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu index 0dd3af6409..bfa97f301a 100644 --- a/util/flash_fp_mcu +++ b/util/flash_fp_mcu @@ -80,27 +80,26 @@ lsbval() { # Get the underlying board (reference design) that we're running on (not the # FPMCU or sensor). get_platform_name() { - # "-l" converts to lowercase - local -l platform_name="$(cros_config /identity platform-name)" + local platform_name - # If we don't get any result from cros_config, then we have to possible cases: + # We used to use "cros_config /identity platform-name", but that is specific + # to mosys and does not actually provide the board name in all cases. + # cros_config intentionally does not provide a way to get the board + # name: b/156650654. + + # If there was a way to get the board name from cros_config, it's possible + # that it could fail in the following cases: # # 1) We're running on a non-unibuild device (the only one with FP is nocturne) # 2) We're running on a proto device during bringup and the cros_config # settings haven't yet been setup. # - # In either case we can fall back to /etc/lsb-release. It's not recommended + # In all cases we can fall back to /etc/lsb-release. It's not recommended # to do this, but we don't have any other options in this case. - # - # TODO(https://crbug.com/984629): cros_config should handle reading - # /etc/lsb-release as backup for us. + echo "Getting platform name from /etc/lsb-release." 1>&2 + platform_name="$(lsbval "CHROMEOS_RELEASE_BOARD")" if [[ -z "${platform_name}" ]]; then - echo "Getting platform name from cros_config failed." \ - "Falling back to /etc/lsb-release." 1>&2 - platform_name="$(lsbval "CHROMEOS_RELEASE_BOARD")" - if [[ -z "${platform_name}" ]]; then - exit 1 - fi + exit 1 fi echo "${platform_name}" |