summaryrefslogtreecommitdiff
path: root/util/check_allowed.sh
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-04-30 13:01:42 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-30 22:51:12 +0000
commit39d7af5b215a544fb6fa6f8a32ea2fc3c9cb9ce5 (patch)
tree700db51b372ee01d37196f28a3466f4de6c01f66 /util/check_allowed.sh
parentcaab3a60b0403e7059f83bbcc1deb09fa565beb7 (diff)
downloadchrome-ec-39d7af5b215a544fb6fa6f8a32ea2fc3c9cb9ce5.tar.gz
zephyr: fix namespace for Kconfig check scripts
Update both the scripts used to verify that ad-hoc CONFIG options have a Kconfig option to use the same search criteria. The list of Kconfigs is now all option that start with the config or menuconfig keyword. The full Kconfig list is transformed to replace CONFIG_PLATFORM_EC_ with CONFIG_, to match the Chromium EC namespace. BUG=b:184037201 BRANCH=none TEST=make buildall TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I5edeeddd4e935b4bbf2ce7321a19249a543d916e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2860985 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'util/check_allowed.sh')
-rwxr-xr-xutil/check_allowed.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/util/check_allowed.sh b/util/check_allowed.sh
index 03b6df8fe9..0881409036 100755
--- a/util/check_allowed.sh
+++ b/util/check_allowed.sh
@@ -41,6 +41,7 @@ tmp=$(mktemp -d)
# Temporary files
new_configs="${tmp}/configs"
suspects="${tmp}/suspects"
+kconfigs="${tmp}/kconfigs"
ok="${tmp}/ok"
new_adhoc="${tmp}/adhoc"
@@ -54,9 +55,13 @@ sed -n 's/^\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' "${config}" | sort | uniq \
comm -23 "${new_configs}" "${allow}" > "${suspects}"
# Find all the Kconfig options so far defined
-find "${srctree}" -name "Kconfig*" -exec cat {} \; | sed -n -e \
- 's/^\s*\(config\|menuconfig\) PLATFORM_EC_\([A-Za-z0-9_]*\)$/CONFIG_\2/p' \
- | sort | uniq > "${ok}"
+find "${srctree}" -type f -name "Kconfig*" -exec cat {} \; | sed -n -e \
+ 's/^\s*\(config\|menuconfig\) *\([A-Za-z0-9_]*\)$/CONFIG_\2/p' \
+ | sort | uniq > "${kconfigs}"
+
+# Most Kconfigs follow the pattern of CONFIG_PLATFORM_EC_*. Strip PLATFORM_EC_
+# from the config name to match the cros-ec namespace.
+sed -e 's/^CONFIG_PLATFORM_EC_/CONFIG_/p' "${kconfigs}" | sort | uniq > "${ok}"
# Complain about any new ad-hoc CONFIGs
comm -23 "${suspects}" "${ok}" >"${new_adhoc}"