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. */"