From 46a8cf53e000bffdd3b201d33ccc092d73b460c8 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Tue, 21 Jul 2020 15:16:21 -0700 Subject: private-cr5X: add relevant git trees sha values to the version string Version strings of the boards built from the private directories should include git status information from all git trees used to build the images. BUG=none TEST=tried running 'BOARD=xyz ./util/getversion.sh' and verified that the expected git trees are added to the version string. Signed-off-by: Vadim Bendebury Change-Id: I5414a1de07171d37277ba508551a79ba84776ac6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2310777 Reviewed-by: Namyoon Woo --- util/getversion.sh | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/util/getversion.sh b/util/getversion.sh index 6fa0ad4fbe..eb1f310396 100755 --- a/util/getversion.sh +++ b/util/getversion.sh @@ -82,6 +82,7 @@ main() { local gitdate local global_dirty local most_recent_file + local root local timestamp local tool_ver local values @@ -94,15 +95,24 @@ main() { global_dirty= # set if any of the component repos is 'dirty'. dir_list=( . ) # list of component directories, always includes the EC tree - case "${BOARD}" in - (cr50) - dir_list+=( ../../third_party/tpm2 ../../third_party/cryptoc ) - ;; - (*_fp) - dir_list+=( ./private ) - ;; - esac - + if [[ -n ${BOARD} ]]; then + case "${BOARD}" in + (cr50) + dir_list+=( ../../third_party/tpm2 ../../third_party/cryptoc ) + ;; + (*_fp) + dir_list+=( ./private ) + ;; + (*) + # For private-crX boards add their git root and cryptoc. + for root in private-cr5*; do + if [[ -d "${root}/board/${BOARD}" ]]; then + dir_list+=( "${root}" ../../third_party/cryptoc ) + fi + done + ;; + esac + fi # Create a combined version string for all component directories. for git_dir in ${dir_list[@]}; do pushd "${git_dir}" > /dev/null -- cgit v1.2.1