diff options
author | Patrick Georgi <pgeorgi@google.com> | 2018-11-17 19:52:09 +0100 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-27 00:34:06 -0800 |
commit | 06d75d91555d5fc59862684e550c5fc915167660 (patch) | |
tree | d1b87f7e164c7cc81464320d0458752b280dfa20 /util | |
parent | cc5eff10d44e5c29fe98c5845dc1a57ce9d635eb (diff) | |
download | chrome-ec-06d75d91555d5fc59862684e550c5fc915167660.tar.gz |
util/getversion.sh: Allow predictable reproducible builds
The resulting binary shouldn't depend on the user or hostname,
at least when the user explicitly asks for reproducible builds.
Change-Id: I95604cfd93028b8d60e11550d4322424088f425f
Signed-off-by: Nico Huber <nico.h@gmx.de>
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1341410
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-x | util/getversion.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/util/getversion.sh b/util/getversion.sh index 07ebec9d7c..c0ab6ff89f 100755 --- a/util/getversion.sh +++ b/util/getversion.sh @@ -119,7 +119,11 @@ echo "#define CROS_ECTOOL_VERSION \"${tool_ver}\"" echo "/* Sub-fields for use in Makefile.rules and to form build info string" echo " * in common/version.c. */" echo "#define VERSION \"${ver}\"" -echo "#define BUILDER \"${USER}@`hostname`\"" +if [ "$REPRODUCIBLE_BUILD" = 1 ]; then + echo '#define BUILDER "reproducible@build"' +else + echo "#define BUILDER \"${USER}@`hostname`\"" +fi if [ -n "$global_dirty" ]; then echo "/* Repo is dirty, using time of last compilation */" |