From 18022d98d9905692debf7add00083c119f52547f Mon Sep 17 00:00:00 2001 From: Bobby Casey Date: Fri, 21 Apr 2023 00:39:09 -0400 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3864978 Reviewed-by: Josie Nordrum Reviewed-by: Tom Hughes --- util/flash_ec | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.1