From ea91c71c089b1a75ddcc4e90a0c38ea3b1578d6c Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Fri, 29 Jul 2016 16:55:55 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/364490 Reviewed-by: Bill Richardson --- util/getversion.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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. */"