diff options
author | Matthew Blecker <matthewb@google.com> | 2019-04-08 11:33:06 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-09 06:19:54 -0700 |
commit | 8530e53965b9eb8cc18d9fd9fdae2cadb6dcc8c3 (patch) | |
tree | 16d80b145b7e64bf98a40e554c8526dbb3342ce5 | |
parent | 46e28e28c2973db09dd9a7a2c14db3cd2609905a (diff) | |
download | chrome-ec-8530e53965b9eb8cc18d9fd9fdae2cadb6dcc8c3.tar.gz |
flash_ec: Update error msg and TODO bug num for servo I2C adapter lookup.
This also removes the placeholder code for a dut-control command that does
not actually exist yet.
BRANCH=none
BUG=b:79684405,b:130165933
TEST=Ran flash_ec using Servo v4 -> Servo Micro -> Ampton.
With i2c-pseudo loaded and servod running, reflashing worked.
With i2c-pseudo unloaded and servod running, the new error message
was written stderr and flash_ec exited non-zero as desired.
Change-Id: Icfa4f4a894eda6c683a2d1cef4a87b3ac3a0a359
Signed-off-by: Matthew Blecker <matthewb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1558371
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
-rwxr-xr-x | util/flash_ec | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/util/flash_ec b/util/flash_ec index 8456da6932..3b0dac40aa 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -1039,9 +1039,10 @@ function flash_stm32_dfu() { $DFU_UTIL -a 0 -s ${ADDR}:${SIZE} -D "${IMG}" } +# TODO(b/130165933): Implement a dut-control command to look up the correct +# I2C adapter number, and use that here in place of the hack of looking at +# I2C adapter names. function dut_i2c_dev() { - # TODO(b/79684405): Drop support for $DUT_I2C_DEV env var override - # as soon as dut-control dut_i2c_dev command is implemented. if [ -n "$DUT_I2C_DEV" ]; then [ -e "$DUT_I2C_DEV" ] || die "\$DUT_I2C_DEV is a non-existent path: $DUT_I2C_DEV" @@ -1049,9 +1050,7 @@ function dut_i2c_dev() { return fi - # TODO(b/79684405): Drop this hack as soon as dut-control dut_i2c_dev - # command is implemented. - if ( + if ! ( set -e cd /sys/class/i2c-dev # Sorting in reverse numerical order generally picks the correct @@ -1065,18 +1064,9 @@ function dut_i2c_dev() { done false ); then - return + die "Could not find servo I2C adapter. This could be because "\ +"the i2c-pseudo module was not loaded when servod was started." fi - - # TODO(b/79684405): This should just work once a dut-control dut_i2c_dev - # command is implemented. - local dut_i2c_dev="$("${DUT_CONTROL_CMD[@]}" dut_i2c_dev)" || - die "dut-control dut_i2c_dev exited $? (non-zero)" - dut_i2c_dev="$(echo "$dut_i2c_dev" | sed -e 's/^dut_i2c_dev://')" - [ -e "$dut_i2c_dev" ] || - die "dut-control dut_i2c_dev returned non-existent path: "\ -"$dut_i2c_dev" - echo "$dut_i2c_dev" } function flash_it83xx() { |