summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-08-30 09:52:26 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-01 18:09:21 +0000
commit7477b9225c6ff8418feb7424e4f1cc221f4e3353 (patch)
tree7a8fdf97366e682aa1b126e231b47888b78e6c60
parentcca968409b3b37049c98b760fc8a094eb777f6f9 (diff)
downloadchrome-ec-7477b9225c6ff8418feb7424e4f1cc221f4e3353.tar.gz
util/flash_ec: Fix shellcheck warning
DEFINE_string board "${DEFAULT_BOARD}" \ ^--------------^ SC2154: DEFAULT_BOARD is referenced but not assigned. The DEFAULT_BOARD variable is never set, so replace it with an empty string and print an error if the board is not specified. BRANCH=none BUG=b:242127759 TEST=./util/flash_ec --board=dartmonkey Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I433bbd6105debc2494fc93f8987e6fe271ef93d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3864975 Reviewed-by: Andrea Grandi <agrandi@google.com>
-rwxr-xr-xutil/flash_ec6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/flash_ec b/util/flash_ec
index caa9861007..c4112f31f1 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -149,7 +149,7 @@ BITBANG_RATE="57600" # Could be overwritten by a command line option.
DEFINE_integer bitbang_rate "${BITBANG_RATE}" \
"UART baud rate to use when bit bang programming, " \
"standard UART rates from 9600 to 57600 are supported."
-DEFINE_string board "${DEFAULT_BOARD}" \
+DEFINE_string board "" \
"The board to run debugger on."
DEFINE_string chip "" \
"The chip to run debugger on."
@@ -268,6 +268,10 @@ function dut_control_get_or_die {
: "${BOARD:=${FLAGS_board}}"
+if [ "${BOARD}" == "" ]; then
+ die "Must specify board."
+fi
+
in_array() {
local n=$#
local value=${!n}