summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2023-03-08 16:14:26 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-13 20:05:47 +0000
commitb5b0f38a64d96d9014cbb025ae9bf2546881cbb0 (patch)
tree70752f95ce5e5c7ae61bb0aad03e49b9931ced78 /util
parent38d981d3a0d7298770f318c6c8c50e0ac5c39bf2 (diff)
downloadchrome-ec-b5b0f38a64d96d9014cbb025ae9bf2546881cbb0.tar.gz
util: Use check_patch from Zephyr not repohooks
Zephyr code base is more integrated to cros_ec codebase than repohooks. Do not depend on scripts deep inside repohooks. BUG=b:272119670 BRANCH=none TEST= - Touch make_linux_ec_commands_h.sh Make sure check triggers an error as before - Add a #if 0 in ec_commands.h, commit code locally + make build_cros_ec_commands + repo upload --verify report a warning, check_patch wants the code removed. + Check repo upload works both in and outside chroot + Check repo works in any platform/ec/ subdirectory. Change-Id: Ifb0f232460d85c708cafab65c2551e6992036e25 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4322620 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/linux_ec_commands_h_check.sh4
-rwxr-xr-xutil/make_linux_ec_commands_h.sh10
2 files changed, 4 insertions, 10 deletions
diff --git a/util/linux_ec_commands_h_check.sh b/util/linux_ec_commands_h_check.sh
index d24beb9b54..e10687e980 100755
--- a/util/linux_ec_commands_h_check.sh
+++ b/util/linux_ec_commands_h_check.sh
@@ -6,6 +6,8 @@
set -e
+: "${ZEPHYR_BASE:=$(realpath ../../../src/third_party/zephyr/main)}"
+
ec_commands_file_in="include/ec_commands.h"
ec_commands_file_out="build/kernel/include/linux/mfd/cros_ec_commands.h"
@@ -23,3 +25,5 @@ if [ "${ec_commands_file_out}" -ot "${ec_commands_file_in}" ]; then
echo 'Please run "make buildall" or "make build_cros_ec_commands"'.
exit 1
fi
+
+"${ZEPHYR_BASE}/scripts/checkpatch.pl" -f "${ec_commands_file_out}"
diff --git a/util/make_linux_ec_commands_h.sh b/util/make_linux_ec_commands_h.sh
index 66c4360230..dfb2c6919a 100755
--- a/util/make_linux_ec_commands_h.sh
+++ b/util/make_linux_ec_commands_h.sh
@@ -27,12 +27,6 @@ if [ $# -ne 2 ]; then
exit 1
fi
-if [ ! -d "${CROS_WORKON_SRCROOT}" ]; then
- printf "Not in Chrome OS chroot!\n\n"
- usage
- exit 0
-fi
-
out_dir="$(dirname "${out}")"
mkdir -p "${out_dir}"
tmp="$(mktemp -p "${out_dir}" cros_ec_XXX.h)"
@@ -75,8 +69,4 @@ sed -i "s/INT\([0-9]\{1,2\}\)_MIN/S\1_MIN/" "${tmp}"
unifdef -x2 -m -UCONFIG_HOSTCMD_ALIGNED -U__ACPI__ -D__KERNEL__ -U__cplusplus \
-UCHROMIUM_EC "${tmp}"
-# Check kernel checkpatch passes.
-# TODO(b/272119670) Calling the hook directly leaves us open to breakages.
-"${CROS_WORKON_SRCROOT}/src/repohooks/third_party/checkpatch.pl" -f "${tmp}"
-
cp "${tmp}" "${out}"