summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby Casey <bobbycasey@google.com>2023-04-21 00:39:09 -0400
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-11 17:43:24 +0000
commit18022d98d9905692debf7add00083c119f52547f (patch)
tree73530299ecc6f426769e3d01d9c0bc301f09036b
parent454f4b32f8b010b9267d6c47f81502dfdffc6a24 (diff)
downloadchrome-ec-18022d98d9905692debf7add00083c119f52547f.tar.gz
flash_ec: Fix shellcheck warning SC2009
The error was: Hook script "cros lint ${PRESUBMIT_FILES}" failed with code 1: In util/flash_ec line 854: if ps -o cmd= "${pid}" | grep -qE "(servod|/sbin/init)"; then ^ SC2009 (info): Consider using pgrep instead of grepping ps output. Unfortunately, per this thread crrev.com/c/3864978/4/util/flash_ec#857 it seems like the ps / grep solution is our best bet so shellcheck exclusion was added. BRANCH=none BUG=b:242127759 TEST=util/flash_ec --board=dartmonkey --image build/dartmonkey/ec.bin Change-Id: I271384dae6d0edd9a84546883b799a5a8fe64207 Signed-off-by: Bobby Casey <bobbycasey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3864978 Reviewed-by: Josie Nordrum <josienordrum@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
-rwxr-xr-xutil/flash_ec1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/flash_ec b/util/flash_ec
index bc09c4c9c2..3d1f949996 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -850,6 +850,7 @@ function claim_pty() {
# reverse order to SIGSTOP parents before children
for pid in $(echo "${pids}" | tac -s " "); do
+ # shellcheck disable=SC2009
if ps -o cmd= "${pid}" | grep -qE "(servod|/sbin/init)"; then
info "Skip stopping servod or init: process ${pid}."
else