summaryrefslogtreecommitdiff
path: root/util/getversion.sh
Commit message (Collapse)AuthorAgeFilesLines
* getversion.sh: Generalize FP targets for nucleo-*Craig Hesling2020-03-041-1/+1
| | | | | | | | | | | | | | | | | | The nucleo-dartmonkey and future nucleo-bloonchipper will use the fingerprint private blobs and are designed to align as closely to dartmonkey and bloonchiper as possible. This patch makes these version strings equal too. BRANCH=none BUG=none TEST=make BOARD=nucleo-dartmonkey && strings build/nucleo-dartmonkey/ec.bin | grep dart TEST=make BOARD=dartmonkey && strings build/dartmonkey/ec.bin | grep dart TEST=make BOARD=bloonchipper && strings build/bloonchipper/ec.bin | grep bloon Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I8a4bce559a8c94222558e37b51b6a302595f29c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2086733 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* getversion.sh: Add cryptoc git hash for fingerprintCraig Hesling2020-03-041-0/+3
| | | | | | | | | | | BRANCH=none BUG=none TEST=make BOARD=dartmonkey && strings build/dartmonkey/ec.bin | grep dart Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I845a6b72ca2489f8a89d9a856820300af0375e32 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2086556 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* getversion.sh: Add private/.../fpc git hash for fingerprintCraig Hesling2020-03-041-0/+3
| | | | | | | | | | | | | | | | | | | | | Since we have moved the private FPC code/blobs into a sub-repository under private/, we should also represent the sub-repo in the version string. It now shows up as an additional "fpc:vBLAH-HASH". BRANCH=none BUG=b:150731735 TEST=make BOARD=dartmonkey && strings build/dartmonkey/ec.bin | grep dart TEST=make BOARD=nocturne_fp && strings build/nocturne_fp/ec.bin | grep noct TEST=make BOARD=bloonchipper && strings build/bloonchipper/ec.bin | grep bloon TEST=make BOARD=hatch_fp && strings build/hatch_fp/ec.bin | grep hatch TEST=make BOARD=nami_fp && strings build/nami_fp/ec.bin | grep nami Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ibf045a4f853e3a3589d84d8a62a726264223387e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2086732 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util: Fix shellcheck warnings in getversion.shTom Hughes2020-02-241-13/+14
| | | | | | | | | | | | | | | | BRANCH=none BUG=none TEST=make buildall -j TEST=for i in $(ls build); do \ bcompare build/$i/ec_version.h \ build.new/$i/ec_version.h; done Change-Id: If7c30746816075ab9958da96466b3a834746b0e1 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2063377 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Raul E Rangel <rrangel@chromium.org> Commit-Queue: Raul E Rangel <rrangel@chromium.org>
* util: Consistently truncate version stringTom Hughes2020-02-201-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | If the initial version string (board_major_branch_numcommits_hash) was longer than 31 characters, it was being truncated to 31 characters. However, this truncated version was not being used in the long version string (that includes the private repos), which was leading to different versions being shown with the "ectool version" command. Example: RO version: bloonchipper_v2.0.3266-78dbc6df RW version: bloonchipper_v2.0.3266-78dbc6df Build info: bloonchipper_v2.0.3266-78dbc6dfc This commit ensures that we use the truncated version everywhere for consistency. BRANCH=none BUG=b:149597326 TEST=make buildall -j TEST=bloonchipper> version Change-Id: Iefd6f261fb9f16353c0e9177f0af88d7525b48ef Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2062988 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* dartmonkey/bloonchipper: Add private version tagCraig Hesling2020-02-011-1/+1
| | | | | | | | | | | | | | | | This enables the private git directory version string inclusion for dartmonkey and bloonchipper. This should have been added when we transitioned to the new naming scheme. BRANCH=hatch BUG=none TEST=BOARD=dartmonkey ./util/getversion.sh TEST=BOARD=bloonchipper ./util/getversion.sh Change-Id: Ib24cf96869f11bb8c4391ed7abb02c4abbe3abd8 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2032790
* nocturne_fp/hatch_fp: Fix getversion without privateCraig Hesling2020-02-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Public builds do not have the private directory, thus they cannot have a valid private version tag. Without this fix, the following errors were emitted during build and the build VERSION would have an invalid private version tag appended to it: ./util/getversion.sh: line 114: pushd: ./private: No such file or directory ./util/getversion.sh: line 124: popd: directory stack empty The invalid version would end up being the same git version as the root repository, since the pushd fails. An alternative would be to detect that the directory did not exist and add a does-not-exist private VERSION tag, but I feel that that simply degrades/taints a public build. Furthermore, other boards may want a missing directory to cause an build error/warning. BRANCH=nocturne,hatch BUG=none TEST=BOARD=nocturne_fp ./util/getversion.sh # Observe the #define VERSION line TEST=BOARD=hatch_fp ./util/getversion.sh # Observe the #define VERSION line TEST=make BOARD=nocturne_fp TEST=make BOARD=hatch_fp Change-Id: I242e19d35f34599639dee7e74ffd4199f6b34c89 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2032789
* get_version.sh: add an option for non-changing version fileJack Rosenthal2020-01-131-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | | I've made a hack similar to this a few times when I needed to test that applying commit(s) did not change a certain ec.bin file. get_version.sh already had a REPRODUCIBLE_BUILD option, which is useful for testing that compiling under a different user/host would not change the build, but did not allow testing compiling under a different commit. This adds another option, STATIC_VERSION, which allows different user, host, and commit/repository state. Usage: make BOARD=foo STATIC_VERSION=1 BUG=none BRANCH=none TEST=compile at different commits, observe ec.bin file does not change. Change-Id: I5fc277791cb272317fac2471f763b40290118e1d Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1997735 Reviewed-by: Jett Rink <jettrink@chromium.org>
* cr50: do not enable TPM when compiling for dcrypto testsVadim Bendebury2019-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no room in the flash for both dcrypto tests and the TPM library. Let's disable TPM function (and not link the library) when the image is compiled with dcrypto tests included. BRANCH=cr50, cr50-mp BUG=b:137659935 TEST=verified that there is plenty of room for tests now: $ make BOARD=cr50 -j -k CRYPTO_TEST=1 CR50_DEV=1 . . . *** 8124 bytes in flash and 61564 bytes in RAM still ... in cr50 RO *** *** 66100 bytes in flash and 6000 bytes in RAM still ... in cr50 RW *** - building without CRYPTO_TEST=1 still produces a functional Cr50 image; - when building with CRYPTO_TEST=1, the version string reflects it: $ strings build/cr50/ec.bin | grep cr50_v | head -1 DBG/CT/cr50_v2.0.1776-46b015f6a - CCD of the images built with crypto test enabled is fully functional, in particular USB updates are operational. Change-Id: Iae91ca36dc203301ac423fe048fc67eb44ef5de6 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704608 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-191-1/+1
| | | | | | | | | | | | | | | | Ran the following command: git grep -l 'Copyright (c)' | \ xargs sed -i 's/Copyright (c)/Copyright/g' BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* util/stm32mon: Add cmdline option to display versionTom Hughes2019-04-241-0/+3
| | | | | | | | | | | | | | | | | | | Also display the version when running in order to make it easier to debug flashing issues in the field or factory. BRANCH=none BUG=chromium:952332 TEST=./util/flash_ec --board=hatch_fp --image=./build/hatch_fp/ec.bin => displays stm32mon version ./build/hatch_fp/util/stm32mon -v => displays version ./build/hatch_fp/util/stm32mon --version => displays version Change-Id: I43f622ed370938eeed31453d5b11806f02b47277 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1565462 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* *_fp: Add private version infoTom Hughes2019-04-181-0/+3
| | | | | | | | | | | | | | | | | | This shows up when you run the "version" command in the UART console. BRANCH=none BUG=b:130417373 TEST=BOARD=hatch_fp ./util/getversion.sh => shows private version in VERSION BOARD=nocturne_fp ./util/getversion.sh => shows private version in VERSION BOARD=nocturne ./util/getversion.sh => does not show private version in VERSION Change-Id: Ibdf94795bbc8bc823d29ec006b01fc89e8f37114 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1566040 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* cr50: add support for building CR50_SQA imagesMary Ruthven2019-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Devices in the lab need to be switched from prepvt to pvt flags. This change adds a build flag for CR50_SQA. Images built with CR50_SQA have more capabilities than normal cr50 images, but less than CR50_DEV images. SQA images can access the rollback command, updates including downgrading to images with lower version numbers and mismatched board id will not be rejected, and the 'bid force_pvt' console command can be used to set the bid flags to 0. bid force_pvt does not erase flashinfo. After the board id has been set, we can still change 1 bits to 0, so we don't need to eraseflashinfo to change the board id flags to 0. This makes the command a bit safer, because the board id RLZ can't be changed just the flags. Changing the flags to 0 works for the test team, because it prevents cr50 from updating to prepvt. This change also marks rollback as a safe command. CR50_SQA images aren't automatically open, so if rollback isn't safe, they will have to go through the open process to change to pvt. Rollback is only included in DEV and SQA images, so it's ok if it's marked safe. It's understood these images aren't supposed to be used on regular devices. They're just for special development and test environments. NEW PROCESS FOR SQA: - update to sqa image - run 'bid force_pvt' - flash pvt image - run rollback BRANCH=cr50 BUG=b:126618143 TEST=run sqa process Change-Id: Ia713274830c9e19cdb3ccafa87849c160d667683 Signed-off-by: Mary Ruthven <mruthven@google.com> Reviewed-on: https://chromium-review.googlesource.com/1529834 Commit-Ready: Mary Ruthven <mruthven@chromium.org> Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* getversion.sh: use better timestamp algorithmVadim Bendebury2019-02-051-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running ./util/getversion.sh in a 'dirty' tree do not generate the timestamp containing the current time, find out outstanding files (including those not yet included in git) and use the timestamp of the most recent of these files. The generated date is not accurate in some cases: files not included in the tree possibly are not part of the build either, so their modification should not be causing the generated timestamp change. Also, if a previously modified file was checked out from git HEAD, it will not be included in the timestamp string generation. These inaccuracies are not that important: worst case one of the builds would have incorrect timestamp, not a big deal for the case when there are local tree modifications. The big advantage of the new timestamp generation scheme is that if there has been no changes in the tree, the new ec_version.h file is not generated, which prevents re-compilation of board.c. This is necessary to achieve no rebuilds when make is invoked on a tree which has not been modified since previous make invocation. BRANCH=none BUG=none TEST=running 'make BOARD=cr50' does not trigger re-compiling of board.c any more, the timestamp included in the build is the timestamp of the most recent modification of the checked out files in the tree Change-Id: I7c931e4965811faa8079d6762b9b9a57a6bb20bb Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1450182 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* getversion: move main code into functionVadim Bendebury2019-02-051-51/+64
| | | | | | | | | | | | | | | | This is a no-op change of moving the main script program into a function as is. This will make it easier to modify script behavior when necessary. BRANCH=none BUG=none TEST=verified that script output is the same as before this modification. Change-Id: I721f88feace5e29e6dcc20086a113cb185f4d699 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1450181 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* util/getversion.sh: Allow predictable reproducible buildsPatrick Georgi2018-11-271-1/+5
| | | | | | | | | | | | | 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>
* util: do not generate redundant CROS_EC_VERSIONVadim Bendebury2018-05-221-3/+0
| | | | | | | | | | | | | | | The values of CROS_EC_VERSION and VERSION variables generated by getversion.sh are exactly the same. VERSION is used in more places than CROS_EC_VERSION, let's keep VERSION and use it everywhere. BRANCH=none BUG=chromium:632937 TEST=make buildall Change-Id: Ibec9ecdd4b67789a468dddfbc1c82565f90d48a8 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1069330 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* ectool: Don't use board name in ectool tool versionFurquan Shaikh2018-05-011-0/+5
| | | | | | | | | | | | | | | | | | | When using unified images, it might be confusing to have a single board name in the tool version. Since tool version was added to check for compatibility, it is sufficient to look at the sha versions without the actual board name. BUG=None BRANCH=None TEST=Verified that "ectool version" does not report board name in tool version. Change-Id: I862956791706f8a8d508b780bf050caee7c7ccd2 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1036114 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* util: move 'dirty' marker to be a prefix, not a suffixVadim Bendebury2017-09-151-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With longer git SHA1s reported by git commands and longer version strings, the entire SHA1 could be not fitting into the 32 byte version of the VERSION string. So, instead of adding the 'dirty' marker to the end of SHA1 let's replace the prefix dash with it in case the tree is dirty. This way the length of the version string does not change (as long as the 'dirty' marker is one character long). BRANCH=cr50 BUG=b:64698702 TEST=verified output of running getversion.sh with a clean tree $ ./util/getversion.sh | grep VERSION32 #define CROS_EC_VERSION32 "_v1.1.7046-591608e2e" and a 'dirty' tree $ ./util/getversion.sh | grep VERSION32 #define CROS_EC_VERSION32 "_v1.1.7046+591608e2e" Change-Id: I42684522beaff9e9714206cfaddaf97e6cd644be Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/665958 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* cr50: change DEV to DBG in debug images version stringsVadim Bendebury2017-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two types of signing of CR50 images - prod and dev. Designating images built with CR50_DEV variable set in the environment as DEV is confusing, as this has nothing to do with the signing type (dev vs prod), and is in fact indicating an image with many debug features enabled. This patch changes the string to "DBG". BRANCH=cr50 BUG=none TEST=verified that the modified image has correct string in the version field: > vers Chip: g cr50 B2-D Board: 0 RO_A: * 0.0.10/29d77172 RO_B: -1.-1.-1/ffffffff RW_A: 0.0.16/DBG/cr50_v1.1.6137-1624610+ RW_B: * 0.0.16/cr50_v1.1.6137-1624610+ Build: 0.0.16/cr50_v1.1.6137-1624610+ tpm2:v0.0.287-1a68fe6 cryptoc:v0.0.8-6283eee 2017-03-06 16:51:15 vbendeb@eskimo.mtv.corp.google.com > Change-Id: I06a97a6aff5418a4d02e71ca23813e6d2005da5c Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/450903 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* Makefile: Suppress 'Not a git repository' errorsSimon Glass2017-01-141-1/+3
| | | | | | | | | | | | | | | | | | We get a lot of these errors when running the EC Makefile from an ebuild. They are not useful since of course there is no git repo when the source code is built from a copy. An empty date (as produced in this case) is presumably good enough. Suppress these errors by redirecting stderr. BUG=chromium:680243 BRANCH=none TEST=V=0 emerge-reef chromeos-ec; See that the git output is gone Change-Id: Ia3d1e2046c87e0ca88d0c18e432467f9d23b7e9f Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/428156 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* getversion: Fix lucid failing because of version stringsDaisuke Nojiri2016-10-141-4/+1
| | | | | | | | | | | | | | | make build=lucid fails if there is an uncommitted change in the tree because '-dirty' is appended to version strings, which causes the image to exceed the flash size limit. BUG=chromium:654549 BRANCH=none TEST=make buildall -j Change-Id: Ie4a7b4c7dc70846108aed953215f79dc30a10fca Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/396617 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Cr50: Remove private-cr51 from version stringBill Richardson2016-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We no longer depend on this directory, so there's no need to include its sha1sum in the version string. BUG=chrome-os-partner:54101 BRANCH=none TEST=make buildall; try on Cr50 hardware Before > version Chip: g cr50 B2 Board: 0 RO_A: * 0.0.9/0088a3eb RO_B: 0.0.3/8fe06b9e RW_A: * 0.0.6/DEV/cr50_v1.1.5333-cca986c RW_B: 0.0.6/DEV/cr50_v1.1.5334-115b338 Build: 0.0.6/DEV/cr50_v1.1.5333-cca986c private-cr51:v0.0.87-24457f2 tpm2:v0.0.264-5e5aaa3 cryptoc:v0.0.4-5319e83 2016-09-16 21:59:31 wfrichar@wintermute.mt > After > version Chip: g cr50 B2 Board: 0 RO_A: * 0.0.9/0088a3eb RO_B: 0.0.3/8fe06b9e RW_A: 0.0.6/DEV/cr50_v1.1.5333-cca986c RW_B: * 0.0.6/DEV/cr50_v1.1.5334-36b2cee Build: 0.0.6/DEV/cr50_v1.1.5334-36b2cee tpm2:v0.0.264-5e5aaa3 cryptoc:v0.0.4-5319e83 2016-09-19 17:48:17 wfrichar@wintermute.mtv.corp.google.com > Change-Id: I785dff86e6b970219da87c8674f2a324fa074987 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/387238 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* Cr50: Flag unofficial images in the version stringBill Richardson2016-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We often find it handy to build test images that are unlocked or have special powers. To avoid confusing these with production images, this adds a "DEV/" to the version string: "make BOARD=cr50" looks like this: > version Chip: g cr50 B2 Board: 0 RO_A: * 0.0.9/0088a3eb RO_B: 0.0.8/710d4375 RW_A: * 0.0.6/cr50_v1.1.5261-4848d7e RW_B: 0.0.6/cr50_v1.1.5261-4848d7e [...] "CR50_DEV=1 make BOARD=cr50" looks like this: > version Chip: g cr50 B2 Board: 0 RO_A: * 0.0.9/0088a3eb RO_B: 0.0.8/710d4375 RW_A: 0.0.6/cr50_v1.1.5261-4848d7e RW_B: * 0.0.6/DEV/cr50_v1.1.5261-4848d7e [...] BUG=chrome-os-partner:55557 BRANCH=none TEST=make buildall; also.. Build both with and without the CR50_DEV=1 environment variable. Observe that the version string differs even if nothing else does. Change-Id: Ifee9fbf922c2bbb40a1a9d0a716d2d11aa0d3ec2 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/382851 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* util: do not generate unrelated version informationVadim Bendebury2016-07-291-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* util: collect cr50 versions from multiple git treesVadim Bendebury2016-07-281-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cr50 code comes from four different repositories. This patch introduces an array of the repositories where version information is supposed to come from. For all boards but cr50 this array includes just the local repository, for cr50 the array is extended with the three other components. This patch also allows to change the 'tree dirty' marker appended to the sha1s of the 'dirty' trees, having a shorter marker helps to keep multicomponent version strings shorter. All external component's version information in the generated combined version string is prepended by the component's root directory name. BRANCH=ToT BUG=chrome-os-partner:55373 TEST=ran the script for two EC boards, kevin and cr50, verified the output: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv $ BOARD=kevin ./util/getversion.sh /* This file is generated by util/getversion.sh */ /* Version string for use by common/version.c */ /* Version string, truncated to 31 chars (+ terminating null = 32) */ /* Sub-fields for use in Makefile.rules and to form build info string * in common/version.c. */ /* Repo is clean, use the commit date of the last commit */ $ $ BOARD=cr50 ./util/getversion.sh /* This file is generated by util/getversion.sh */ /* Version string for use by common/version.c */ /* Version string, truncated to 31 chars (+ terminating null = 32) */ /* Sub-fields for use in Makefile.rules and to form build info string * in common/version.c. */ /* Repo is clean, use the commit date of the last commit */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ then introduced some local changes in the ec and tpm2 directories and ran the script again. Note the '+' used as the 'dirty' marker in the cr50 string: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv $ BOARD=kevin ./util/getversion.sh /* This file is generated by util/getversion.sh */ /* Version string for use by common/version.c */ /* Version string, truncated to 31 chars (+ terminating null = 32) */ /* Sub-fields for use in Makefile.rules and to form build info string * in common/version.c. */ /* Repo is dirty, using time of last compilation */ $ $ BOARD=cr50 ./util/getversion.sh /* This file is generated by util/getversion.sh */ /* Version string for use by common/version.c */ /* Version string, truncated to 31 chars (+ terminating null = 32) */ /* Sub-fields for use in Makefile.rules and to form build info string * in common/version.c. */ /* Repo is dirty, using time of last compilation */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Change-Id: I4b4ec23ce003970c09442e8d8aeed2306d4e5dd8 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/363917 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* util: refactor getversion.shVadim Bendebury2016-07-281-28/+60
| | | | | | | | | | | | | | | | | | | | | | | It is necessary to collect information about more then one git repositories status for the cr50 board. To facilitate this, separate the code retrieving build version information into a function, get_tree_version(). The function returns a two element string, the version information and the 'dirty' marker in case the tree has any uncommitted changes. The 0x01 character is used to join the elements of the string, which makes it easier to split the string when processing it. BRANCH=ToT BUG=chrome-os-partner:55373 TEST=ran the script before and after changes, observed that generated output is identical. Change-Id: I2c211cbda8c3cab3c8c21b4430e4b3102691e74a Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/362849 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* cleanup: Remove SHIFT_CODE_FOR_TEST handlingShawn Nematbakhsh2016-06-031-4/+0
| | | | | | | | | | | | | | | | | | SHIFT_CODE_FOR_TEST images were used for an old FAFT test but is no longer in use today. BUG=chromium:616806 BRANCH=None TEST=`make buildall -j` CQ-DEPEND=CL:349281 Change-Id: I1b4e8c2560e2a7ff507cf2275dbbbdabf435866b Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/349272 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Tom Tam <waihong@google.com> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* getversion: Use commit date for date stampShawn Nematbakhsh2015-11-171-2/+2
| | | | | | | | | | | | | | | | | | The git author date usually reflects the time a CL was first pushed to gerrit, not the time it lands to the tree. Therefore, the author date is misleading when used as a timestamp. Use the git commit date instead. BUG=chromium:554675 BRANCH=None TEST=Cherry-pick CL:293345 and verify date stamp is today, not last August. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I4fb042d7a706fbb86897b3e383b3242602af242b Reviewed-on: https://chromium-review.googlesource.com/313022 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Make builds repeatable.Bill Richardson2015-09-241-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | We have been using the time of compilation to determine the version string. This CL will keep doing that if the git repo has uncommitted changes, but if the repo is clean we'll just use the author date of the last commit. This ensures that the same source will produce bitwise-identical builds (assuming no toolchain changes, of course). BUG=chrome-os-partner:45616 BRANCH=none TEST=manual cd src/platform/ec make buildall mv build build.one make buildall md5sum build{,.one}/*/ec.bin | sort Observe that successive builds produce identical binaries. Change-Id: Ie2ef44b216586097589c9c15f12e05c87a53f991 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/302140 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* add hash for locally emerged buildsVincent Palatin2015-05-131-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the EC is built using "emerge-<board> chromeos-ec" on a developer workstation with the chromeos-ec package "cros-worked'on", put "1.1.9999-<git-sha1>" rather than "no_version" in the version string. Emerge is exporting the current git SHA-1 hash in the VCSID id but the .git repository is not available during the build. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=try the following build setups: - local emerge $ emerge-smaug chromeos-ec $ strings /build/smaug/firmware/ec.bin | grep ryu ryu_p4p5_1.1.9999-ebe18ef - local build $ make BOARD=ryu_p4p5 $ strings build/ryu_p4p5/ec.bin | grep ryu ryu_p4p5_v1.1.3127-ebe18ef-dirt - trybot build $ cbuildbot --remote -g 270554 smaug-firmware $ tar xvjf firmware_from_sources.tar.bz2 $ strings ec.bin | grep ryu ryu_p4p5_v1.1.3137-9b52578 Change-Id: I386f80d82d95b5e99a1660a1eb242c47c54d17ef Reviewed-on: https://chromium-review.googlesource.com/270554 Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* Add USE_GIT_DATE=1 to make args to build repeatable imagesBill Richardson2015-02-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, every image includes the time of compilation in the build information. This makes it impossible to verify that a particular image came from a particular source code snapshot. With this change, specifying USE_GIT_DATE=1 to the make command will use the author date of HEAD as the timestamp. That means that successive builds from the same source will produce bitwise-identical output (assuming the same toolchain, of course). BUG=none BRANCH=none TEST=manual Do this twice: \rm -rf build make BOARD=cr50 USE_GIT_DATE=1 md5sum build/cr50/ec.bin The md5sum should be the same for both runs. Change-Id: If64307101a453cb13c62fa003f1bf432f4998273 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/252751 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* USB: Remove special case for iVersion string descriptorAnton Staaf2014-11-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the version string was special cased in the USB stack because the build system prevented the inclusion of ec_version.h in any file other than common/version.c. This lead to common/version.c being the only place that the USB version string could be computed and thus the special case of filling in the version string descriptor at run time. This made the USB stack more complex, and lead to the common/version.c file including usb.h, which is actually STM32 specific. Now, the portion of ec_version.h that is deterministic is only updated when something in the tree actually changes (by way of a conditional in the makefile), and ec_version.h no longer has to depend on all object files (other than the special version.o). This allows anyone to include ec_version.h as needed. In particular, each board that wants to define a USB version string can directly include ec_version.h and do so. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j touch files and verify rebuilds happen correctly Change-Id: Ic84d0b9da90f82ebb4630fb550ec841071e25a49 Reviewed-on: https://chromium-review.googlesource.com/227211 Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
* Truncate version string to 32 charactersRandall Spangler2013-07-191-4/+17
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Append "shift" to version string in shifted imageVic Yang2012-07-161-0/+4
| | | | | | | | | | | | | | | | For EC update test, we produce binary-wise shifted image. To make it easier to tell if update has succeeded, let's append "shift" to the verison in this image. BUG=chrome-os-partner:10264 TEST=Build shifted image and check the version string. Change-Id: I16187611cf61fc97a74bc3707a77ad9ad5274f37 Reviewed-on: https://gerrit.chromium.org/gerrit/27577 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* fix version generation scriptVincent Palatin2012-03-021-1/+1
| | | | | | | | | | | | Fix the quoting for git local change detection. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=run ./util/getversion.sh on a repository with and without local changes and observe we no longer have a spurious output on stderr. Change-Id: I40ea4505d175c9135027ba7cf2b787c08eff6f70
* update versioning information stored in the ECVincent Palatin2012-03-021-0/+33
Add build information (date/time/builder) which can be displayed at the EC console. Generate a version from the board name and the branch tag. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chromium-os:27013 TEST=on BDS, run version command on the console. inspect the built binary. Change-Id: Idb1f68898ba6b811d02919f17ab4536ed9f8934a