summaryrefslogtreecommitdiff
path: root/util/getversion.sh
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2016-07-29 16:55:55 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-29 21:37:54 -0700
commitea91c71c089b1a75ddcc4e90a0c38ea3b1578d6c (patch)
tree3752bd1c5862282dc3b456e8cafafcdfe9187135 /util/getversion.sh
parentd6c71d90316ea4af33372bee6c093c65fc0da804 (diff)
downloadchrome-ec-ea91c71c089b1a75ddcc4e90a0c38ea3b1578d6c.tar.gz
util: do not generate unrelated version information
The recent addition of the multicomponent version string for cr50, requires further tweaking of the version generating script. In particular, the CROS_EC_VERSION32 variable used by the "verson" cli command is not supposed to include any information about subcomponents of the image, it should reflect the EC version only. Separating everything after the first space accomplishes that. BRANCH=none BUG=chrome-os-partner:55373 TEST=verified that RO_x and RW_x versions are printed properly: > vers Chip: g cr50 B2 Board: 0 RO_A: 0.0.1/84e2dde7 RO_B: * 0.0.3/8fe06b9e RW_A: cr50_v1.1.4992-7c9f891+ private RW_B: * cr50_v1.1.4989-52b3cc6+ ... Change-Id: I192eb29816dfa963b08aa97f749b978b1367d6b7 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/364490 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'util/getversion.sh')
-rwxr-xr-xutil/getversion.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/util/getversion.sh b/util/getversion.sh
index 83c42d88e5..83a1903c75 100755
--- a/util/getversion.sh
+++ b/util/getversion.sh
@@ -98,13 +98,18 @@ for git_dir in ${dir_list[@]}; do
popd > /dev/null
done
+# On some boards where the version number consists of multiple components we
+# want to separate the first word of the version string as the version of the
+# EC tree.
+IFS=' ' first_word=(${ver})
+
echo "/* This file is generated by util/getversion.sh */"
echo "/* Version string for use by common/version.c */"
echo "#define CROS_EC_VERSION \"${ver}\""
echo "/* Version string, truncated to 31 chars (+ terminating null = 32) */"
-echo "#define CROS_EC_VERSION32 \"${ver:0:31}\""
+echo "#define CROS_EC_VERSION32 \"${first_word:0:31}\""
echo "/* Sub-fields for use in Makefile.rules and to form build info string"
echo " * in common/version.c. */"