diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-07-19 10:48:30 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-07-19 18:01:55 -0700 |
commit | fe76b51da007bf51347ad3c3af549562a6d9979a (patch) | |
tree | e77abe8e897b96156ea0584bd2d9ad312138fb00 /common/version.c | |
parent | db347953e1a463abcb50669988b3f45bd7fbb826 (diff) | |
download | chrome-ec-fe76b51da007bf51347ad3c3af549562a6d9979a.tar.gz |
Truncate version string to 32 characters
The version struct and EC_CMD_GET_VERSION assume 32-character version
strings. But if the git tree is dirty and the board name is long, the
version string overflows that limit.
This change truncates what's stored in the version string to fit.
The build info still contains the full version string, as it did before.
BUG=chrome-os-partner:21156
BRANCH=none
TEST=build BOARD=mccroskey with a dirty tree; it should build.
Then cat build/mccroskey/ec_version.h to see CROS_EC_VERSION32 has
truncated the version string. Then build a platform of your choice
and type 'version' to see that the version string and build info is
still reported correctly.
Change-Id: Ie71b8efd99a83315f8b4d5ad10c51e48781b12f4
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62649
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'common/version.c')
-rw-r--r-- | common/version.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/version.c b/common/version.c index 36567095ff..a2f554e58d 100644 --- a/common/version.c +++ b/common/version.c @@ -12,9 +12,9 @@ const struct version_struct version_data __attribute__((section(".rodata.ver"))) = { CROS_EC_VERSION_COOKIE1, - CROS_EC_VERSION, + CROS_EC_VERSION32, CROS_EC_VERSION_COOKIE2 }; const char build_info[] __attribute__((section(".rodata.buildinfo"))) = - CROS_EC_BUILD_INFO; + CROS_EC_VERSION " " DATE " " BUILDER; |