summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* vboot/secdata: remove retries from rollback functionsJoel Kitching2019-08-132-315/+109
| | | | | | | | | | | | | | | | Assume that transport-layer communication to Cr50 is reliable. No need for retries on reads/writes, or verification after write. BUG=b:124141368, chromium:972956 TEST=make clean && make runtests BRANCH=none Change-Id: Ie57d1eeaa44c338bca289e371c516540aacf9437 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1729713 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: replace VBERROR_INVALID_PARAMETER with vboot2 equivalentJoel Kitching2019-08-133-5/+3
| | | | | | | | | | | | | | | | | Replace vboot1-style VBERROR_INVALID_PARAMETER with vboot2 equivalent VB2_ERROR_INVALID_PARAMETER. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: I46227cd3a7d7ce84654a0093f9d64883c9563381 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728116 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728294 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: replace VBERROR_SIMULATED with VB2_ERROR_MOCKJoel Kitching2019-08-138-34/+32
| | | | | | | | | | | | | | | Replace vboot1-style VBERROR_SIMULATED with VB2_ERROR_MOCK. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: I9f7a21b957097672883a428a5210c14a27852085 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722917 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: replace VBERROR_UNKNOWN with VB2_ERROR_UNKNOWNJoel Kitching2019-08-1312-26/+25
| | | | | | | | | | | | | | | | Replace vboot1-style VBERROR_UNKNOWN with VB2_ERROR_UNKNOWN. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: Icd2158e328142cff69ce94b5396ab021a1f7839c Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728115 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722916 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: replace VBERROR_SUCCESS with VB2_SUCCESSJoel Kitching2019-08-1333-225/+222
| | | | | | | | | | | | | | | | | Replace vboot1-style VBERROR_SUCCESS with VB2_SUCCESS (trivial change since both are equal values). BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: I46e02471a031e9f36ec869d11d0b957d1c1b5769 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728114 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722915 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: fix use of SetVirtualDevMode return valuesJoel Kitching2019-08-134-4/+4
| | | | | | | | | | | | | | | | | SetVirtualDevMode returns vboot error codes, and not TPM error codes. Existing code just so happens to work, since TPM_SUCCESS == VBERROR_SUCCESS. BUG=b:124141368, chromium:988410 TEST=Build locally BRANCH=none Change-Id: Ifc819fdea4e23824d8e6fcf211d7bf66f33cd069 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728293 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: update vboot2 functions to use new vb2_error_tJoel Kitching2019-08-1384-865/+756
| | | | | | | | | | | | | | | | | | To make explicit when vboot2 error codes should be returned, use the new vb2_error_t type on all functions which return VB2_ERROR_* constants. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: Idd3ee8afe8c78347783ce5fa829cb78f1e5719e2 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728113, chromium:1728499 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728292 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* Minor fixes for clangJulius Werner2019-08-092-2/+3
| | | | | | | | | | | | | | | | | | We want to switch over from GCC to clang for userspace utilities. It comes with a new default warning that we happen to trigger, so silence that. It also comes with a dumb reachability checker that can't tell when the use of one variable is guarded by another, so need to unnecessarily initialize a variable in load_kernel_test. BRANCH=none BUG=chromium:991812 TEST=Built for Kevin with clang. Change-Id: If9fc391ade0243aea1cae8d682e31390dc082f77 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1744667 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* image_signing: clean up oci container key referencesMike Frysinger2019-08-094-106/+15
| | | | | | | | | | | | | | | | We never released this feature and we've dropped the logic from newer releases. Purge the signing logic of references to the key. We still need to delete the key in case we're signing an older release branch. BUG=chromium:976916 TEST=signing image w/key deletes it, and signing image w/out key passes BRANCH=None Change-Id: I82b8a4dab5f68e01c54281afd4817eea3dd359ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1742692 Reviewed-by: LaMont Jones <lamontjones@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
* firmware/lib: Add fall through commentsJacob Garber2019-08-072-0/+3
| | | | | | | | | | | | | | | | Implicit fall throughs are a source of Coverity Scan issues, so add comments to mark these instances as intentional. BUG=none TEST=make clean && make runtests BRANCH=none Change-Id: Ic302dcf8998fb1081e5b8258ba703a7527911eee Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Found-by: Coverity CID 198900 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1740446 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* cgpt: Fix format specifiers for uint64_tJacob Garber2019-08-062-3/+3
| | | | | | | | | | | | | | | These variables are all uint64_t, and so we need to use PRIu64 to ensure they are printed with the correct format specifier. BUG=none TEST=make clean && make runtests BRANCH=none Change-Id: Idb8fee0ef525d224670a9d2b3a7915be1b19fd21 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Found-by: Coverity CID 199873, 199878, 199889 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1737200 Reviewed-by: Julius Werner <jwerner@chromium.org>
* cgpt: Fix format specifier for size_tJacob Garber2019-08-061-1/+1
| | | | | | | | | | | | | | Use %zu, which is the format specifier for size_t. BUG=none TEST=make clean && make runtests BRANCH=none Change-Id: I3317c2f6a7b9d95c22a43ae3d786c7d7380342ad Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Found-by: Coverity CID 199882 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1737706 Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: rename VbError_t typedef to vb2_error_tJoel Kitching2019-08-0631-296/+295
| | | | | | | | | | | | | | | | | | | | | | As part of the conversion of error codes from vboot1 to vboot2, replace all instances of VbError_t with vb2_error_t. vboot2 currently uses the int type for return values, but we would like to implement the use of vb2_error_t instead, which is potentially clearer than simply using an int. Existing functions will be converted to use vb2_error_t in a subsequent CL. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: Iee90d9a1f46bcf5f088e981ba6ddbcf886ff0f18 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728112 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722914 Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* vboot/tpm: fix return type inconsistenciesJoel Kitching2019-08-065-17/+28
| | | | | | | | | | | | | | | | | | | TPM errors and vboot errors were getting mixed up. Note that this patch changes a function signature in the vboot1 API. Any callers of the function should be updated accordingly. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: Idf332ca9ac61b5771fccf9e2ce75e8689c0aace9 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1730374 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1729712 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* vboot: join vboot1 and vboot2 errors into same enumJoel Kitching2019-08-067-104/+102
| | | | | | | | | | | | | | | | | | | | It's extremely hard to accomplish anything with two different sets of error codes. Since the two error code sets don't overlap, merge them into the same enum (vb2_return_code). The next step is to get rid of VbError_t and have all functions consistently return vboot2-style int. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: Ie34ac2c30e5d73fe886628e3150cf63543d520af Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728117, chromium:1735666 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722913 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* sign_official_build.sh: Update kern_b_hash to support SHA256stabilize-octopus-12371.15.Bstabilize-12386.Bstabilize-12371.89.Bstabilize-12371.82.Bstabilize-12371.81.Bstabilize-12371.80.Bstabilize-12371.75.Bstabilize-12371.71.Bstabilize-12371.65.Bstabilize-12371.52.Bstabilize-12371.50.Bstabilize-12371.39.Bstabilize-12371.27.Bstabilize-12371.26.Bstabilize-12371.11.Brelease-R77-12371.BJulius Werner2019-07-251-1/+7
| | | | | | | | | | | | | | | | | | | | | We're updating the algorithm for this so the signing scripts have to support it as well. Since we're running ToT signing scripts on older images as well, determine the hash algorithm used in the image by checking its length (40 hex digits for SHA1, 64 for SHA256). BRANCH=None BUG=b:137576540 TEST=$(sign_official_build.sh recovery recovery_image.bin /tmp/scratch/mykeys/ resigned_image.bin) -- used futility to confirm that new image kern_b_hash matches new image KERN-B and uses the expected algorithm (tried with both SHA1 and SHA256) Cq-Depend: chromium:1706624 Change-Id: Ie1a62ad1fd4fbf141cc1c32d592b863f2d43a24e Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1707529 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vboot: deprecate VbExError functionJoel Kitching2019-07-246-44/+13
| | | | | | | | | | | | | | | | Convert uses of this function to call VB2_DEBUG and manually exit if necessary. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: I9006b1a9c66645757d33310d96207233b88eaed5 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1710340 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: remove Boot Descriptor Block (BDB) library and utilitiesJoel Kitching2019-07-2462-9222/+7
| | | | | | | | | | | | | | | | Remove unused BDB code, previously created for a cancelled SoC project. BUG=b:124141368, chromium:986177 TEST=make clean && make runtests BRANCH=none Change-Id: I91faf97d9850f8afb816fa324ad9a4d9f3842888 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1710336 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* set_lsb_release.sh: tell getfattr to use absolute namesQijiang YĆ«ki Ishii2019-07-231-1/+1
| | | | | | | | | | | | | | | | Adding --absolute-names to getfattr to let getfattr not to remove the leading slash, and not to print the warning to stderr. BUG=chromium:954670 TEST=set_lsb_release.sh xx.bin a b TEST=`getfattr: Removing leading '/' from absolute path names` not printed BRANCH=none Change-Id: I6273151713612746443d5d68a8df530f1146a4a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1712890 Tested-by: Qijiang Fan <fqj@google.com> Reviewed-by: LaMont Jones <lamontjones@chromium.org> Commit-Queue: Qijiang Fan <fqj@google.com>
* vboot/futility: update fatal errors to use FATALJoel Kitching2019-07-2213-94/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a mix of: - DIE - Fatal (customly defined in cmd_vbutil_kernel.c) - VbExError ... were all used to print an error message and exit. In the case of futility, standardize on using the FATAL macro defined in futility.h. BUG=b:124141368 TEST=Check that FATAL works correctly: $ build/futility/futility vbutil_key --in a --out a --algorithm 18 FATAL: do_vbutil_key: Unknown option TEST=make clean && make runtests BRANCH=none Change-Id: I97ca1153dc36e7208c69185883518c52d5d75293 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1679799 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot/vboot_display: retrieve from vboot2 data structures when availableJoel Kitching2019-07-221-6/+6
| | | | | | | | | | | | | | | | | | | Preference for vboot2 data structures when available: sd->recovery_reason sd->fw_version_secdata sd->kernel_version_secdatak BUG=b:124141368, b:124192753 TEST=make clean && make runtests BRANCH=none Change-Id: Ifdd77947cabb75e8ac5a838b75cbcd643c6e481e Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1680190 Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* scripts: Update OWNERS file to reflect current ownership.factory-mistral-12361.BLaMont Jones2019-07-211-2/+3
| | | | | | | | | | | | | BUG=chromium:985940 TEST=None BRANCH=none Change-Id: I844074e28a9cf2384bb7dc1593de7d7e01622457 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1710989 Tested-by: LaMont Jones <lamontjones@chromium.org> Auto-Submit: LaMont Jones <lamontjones@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org>
* vboot: use Fatal instead of VbExError in cmd_vbutil_kernelJoel Kitching2019-07-151-5/+3
| | | | | | | | | | | | | BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Iff20dcc3aa47bfa29776609e5b352ea464c18241 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1680189 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* image_signing: drop "install" alias for factoryMike Frysinger2019-07-111-2/+1
| | | | | | | | | | | | | | | We migrated away from this in 2012, so drop the alias. Any devices made around that time won't need new factory images either. BUG=None TEST=None BRANCH=None Change-Id: I72a155d6c4c241781ec07b2ebb9a2393f8470a08 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1679436 Reviewed-by: LaMont Jones <lamontjones@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
* vboot: remove VbPublicKey structJoel Kitching2019-07-108-85/+50
| | | | | | | | | | | | | | | Update all references to vboot2-style struct vb2_packed_key. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: I55a5f6bf315bdb4b83a998759d3732077283998e Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1675871 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: replace Min macro with VB2_MINstabilize-12331.BJoel Kitching2019-07-068-68/+68
| | | | | | | | | | | | | | | | Replace old vboot1-style Min macro with VB2_MIN, and relocate tests accordingly. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: I73d630147eaf23f97dd750769fb1e911dae01848 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1675866 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* futility: updater: Report EC and PD images on emulationHung-Te Lin2019-07-031-6/+14
| | | | | | | | | | | | | | | | | | | | | When testing updater behavior with emulation (--emulate), there was no way to know if EC and PD images were correctly found from archive and expected to be flashed (for example if we want to test the difference between modes). Since we do flash EC/PD in recovery and factory modes, it is better to still allow loading EC/PD images, and simply not writing them (and print some messages as indication) in emulation. BUG=chromium:965092 TEST=make runfutiltests BRANCH=None Change-Id: I3bbbd75cb8adf2e238a593d3dee0b2491abe7719 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1626190 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Dana Goyette <dgoyette@chromium.org>
* make_dev_firmware.sh: correct flashrom examplesRoss Zwisler2019-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was following the advice given in these examples and saw: # flashrom -p bios -w /mnt/stateful_partition/backups/bios_SAMUS_TEST_8028_20190628_100324.fd flashrom v0.9.9 : cc7cca2 : Jun 15 2019 04:36:54 UTC on Linux 4.14.129 (x86_64) Error: Unknown programmer bios. Please run "flashrom --help" for usage info. As you can see in flashrom_bios() in that same file, the "programmer" argument in flashrom that you need to flash the BIOS is "host" not "bios": # flashrom -p host -w /tmp/bios_SAMUS_TEST_8028_20190628_100324.fd flashrom v0.9.9 : 2d00129 : Jun 27 2019 15:16:55 UTC on Linux 4.14.129 (x86_64) flashrom v0.9.9 : 2d00129 : Jun 27 2019 15:16:55 UTC on Linux 4.14.129 (x86_64) Calibrating delay loop... OK. coreboot table found at 0x7ce3a000. ... Erasing and writing flash chip... SUCCESS BUG=none TEST=successfully flashed a backup BIOS image using flashrom BRANCH=none Change-Id: Ib1e10c1e06ad84714853953702328c4f4dadebe7 Signed-off-by: Ross Zwisler <zwisler@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1685859 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
* keygeneration: default to RSA4096 keys.LaMont Jones2019-06-282-9/+28
| | | | | | | | | | | | | | | | | | We are leaving the --4k options since they are (now) no-ops, and existing users of the script may be passing them. Since they are the default, we want to discourage their use, so they are not documented. BUG=b:135130152 TEST=Unit tests pass BRANCH=None Change-Id: I1d73496f45ac0e04657149d438434a33e0e8569b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1680641 Tested-by: LaMont Jones <lamontjones@chromium.org> Commit-Queue: LaMont Jones <lamontjones@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Auto-Submit: LaMont Jones <lamontjones@chromium.org>
* firmware: Print GBB flags at the start of kernel verificationJulius Werner2019-06-281-0/+2
| | | | | | | | | | | | | | | I've had dozens of instances over the years where I had been wondering what GBB flags a given firmware log was running with. Let's just print them. BRANCH=None BUG=None TEST=Booted Cheza. Change-Id: I631dbcffd16f189731ed5881782722e1eec8eb83 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1674967 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: remove VerifyMemberInside functionstabilize-12301.BJoel Kitching2019-06-265-95/+31
| | | | | | | | | | | | | | | | | | Use vboot2-style vb2_verify_member_inside instead. Correct some strings in vboot2 tests to refer to new vboot2 functions instead. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Idb3bcf1657c9d955acc6f93983c7b0c7f06427e3 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1675870 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: remove vboot1 version of ARRAY_SIZE macroJoel Kitching2019-06-265-18/+17
| | | | | | | | | | | | | | | | Macro already exists in vboot2-style 2common.h. Relocate tests accordingly. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: I6b96627a05e8c05ff49b8780fe4472890c2a2043 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1675869 Reviewed-by: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: remove OffsetOf functionJoel Kitching2019-06-265-25/+9
| | | | | | | | | | | | | | | Should use vboot2 equivalent instead: vb2_offset_of BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: I64afc88477cbb615a661833f45761030c55fcdf6 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1675868 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: remove unused CombineUint16Pair functionJoel Kitching2019-06-262-15/+0
| | | | | | | | | | | | | BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Ifd7dcc1414248b025a8a4bc2942db11814bc8be5 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1675865 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: remove vboot1-style VbExDebug functionJoel Kitching2019-06-262-15/+0
| | | | | | | | | | | | | | | Should use VB2_DEBUG macro instead (which uses vb2ex_printf). BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Ia6da51b597cb02d178ab3906022f1f4075b99a60 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1675864 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* futility: drop mtd support via android_mtdutilsMike Frysinger2019-06-262-42/+0
| | | | | | | | | | | | | | | No one is using this, so drop the dependency. BUG=chromium:978563 TEST=cq passes BRANCH=None Change-Id: I50595675f7f24f8af06a5a8ec3de21690e2ecb34 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1677105 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
* vboot: remove VbCommonParams structJoel Kitching2019-06-242-39/+0
| | | | | | | | | | | | | | | | | | | | | | VbCommonParams is now a relic of the past. It was originally used to pass data to VbInit, VbSelectFirmware, VbSelectAndLoadKernel, and VbVerifyMemoryBootImage. The former two are long deprecated and removed, while the latter two now pass information via the vb2_context struct. BUG=b:124141368, b:124192753 TEST=make clean && make runtests BRANCH=none Change-Id: Ie72f1a5308dea4f9abf2738f104cf373d1030623 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1663749 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1663893 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Auto-Submit: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* create_new_android_keys: fix typo.stabilize-kukui-12285.BLaMont Jones2019-06-191-1/+1
| | | | | | | | | | | | BUG=None TEST=manually verified. BRANCH=None Change-Id: I65467d56409bcf608e9c59aa0759e820d11507ed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1667537 Tested-by: LaMont Jones <lamontjones@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: LaMont Jones <lamontjones@chromium.org>
* set_lsb_release.sh: only setfattr for selinux if modifiedQijiang Fan2019-06-191-3/+4
| | | | | | | | | | | | | | | | | | For set_lsb_release.sh called without parameter, it doesn't modify anything in the image, and mount the image ro. Thus setfattr to ensure security.selinux xattr will fail with Read-only filesystem, and is not necessary since nothing has been modified. BUG=chromium:954670 TEST=set_lsb_release.sh xx.bin a b TEST=set_lsb_release.sh xx.bin BRANCH=none Change-Id: I32bf61796c2b60d18e4e62cc43f2d0e9dc75cef5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1666516 Tested-by: Qijiang Fan <fqj@google.com> Commit-Queue: LaMont Jones <lamontjones@chromium.org> Reviewed-by: LaMont Jones <lamontjones@chromium.org>
* lib/ec_sync_all: Reboot EC to RO after successful AUX FW updateKarthikeyan Ramasubramanian2019-06-192-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | Currently some chips that require AUX FW update request EC reboot to RO after the FW update is applied successfully while some chips do not. It is safe to request EC reboot to RO whenever AUX FW update is applied successfully so that all the chips that require AUX FW update gets reset to a clean state. Update tests to handle the updated code flow and return code correctly. BUG=b:128820536,b:119046668 BRANCH=None TEST=Ensure that the device boots to ChromeOS. Force a TCPC FW update and ensure that after it is successfully applied EC reboots to RO. Cq-Depend: chromium:1625866 Change-Id: I72849620d90284e49cd1a9b31fc5eadede455c51 Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://chromium-review.googlesource.com/1627302 Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Commit-Ready: Karthikeyan Ramasubramanian <kramasub@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: fix vb2_gbb_read_recovery_key to save into intJoel Kitching2019-06-182-20/+22
| | | | | | | | | | | | | | | | | Return value of vb2_gbb_read_recovery_key should be saved into an integer, not into vboot1-style VbError_t. BUG=b:124141368, chromium:954774 TEST=make clean && make runtests BRANCH=none Change-Id: Icbe622c9958d3f303da0faf7b52b0ce52c2b16a5 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1648093 Tested-by: Joel Kitching <kitching@chromium.org> Auto-Submit: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org>
* lib/vboot_kernel: Log speed at which kernel was loadedRaul E Rangel2019-06-181-1/+9
| | | | | | | | | | | | | | | | | | | This makes it easy to spot the speed at which the eMMC controller is running. vb2_load_partition: read 8419 KB in 48 ms at 174342 KB/s. The calculation looks a little funky because I wanted to perform all multiplications before the division to avoid losing any precision. BRANCH=grunt BUG=b:122244718 TEST=Verified it on grunt Change-Id: I5fac584994bc478bfb27cbd4e2ea34af0be7f1d9 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1661366 Reviewed-by: Julius Werner <jwerner@chromium.org>
* updater: Add quirk for wilco devicesDuncan Laurie2019-06-152-0/+41
| | | | | | | | | | | | | The ME unlock needs a different pattern for these devices. BUG=b:135216986 BRANCH=none TEST=test update from unlocked to locked image on sarien Change-Id: I928ee3de522937d5b972daaec4460dcc731b495e Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1659534 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* vboot: add vb2api_gbb_get_flags functionJoel Kitching2019-06-143-0/+26
| | | | | | | | | | | | | | BUG=b:124141368, chromium:954774 TEST=make clean && make runtests BRANCH=none Change-Id: I7b422e8a26621720a6b7efc5211629996a6aa385 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1659989 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org> Auto-Submit: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: export offset and type of GBB struct flags memberJoel Kitching2019-06-142-6/+16
| | | | | | | | | | | | | | | | | | | Export information about vb2_gbb_header's flags member: * vb2_gbb_flags_t * VB2_GBB_FLAGS_OFFSET BUG=b:124141368, chromium:954774 TEST=make clean && make runtests BRANCH=none Change-Id: I2923156edd06df02751ccded5dcbb5bf8fe0207d Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1657503 Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org> Auto-Submit: Joel Kitching <kitching@chromium.org>
* vboot: correct VB2_SECDATAK_SIZE constant to 13Joel Kitching2019-06-133-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | This constant was incorrectly set to 14, whereas sizeof(vb2_secdatak) is 13. Update the constant its correct value, and add a test for each of secdata and secdatak to check the constant values. Previously, this constant was not used anywhere. The secdatak space is created and initialized in coreboot with a hard-coded (correct) size and initial value. So there should be no worry about devices out in the field with TPM secdatak size set to 14. BUG=b:124141368, chromium:972956 TEST=make clean && make runtests BRANCH=none Change-Id: I0a6072aef2de401bd3cd40ac3b002f754da19560 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1655049 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org>
* vboot: expose vb2api_secdatak_check and vb2api_secdatak_createJoel Kitching2019-06-1316-94/+38
| | | | | | | | | | | | | | | | | | | | | | Previously vb2api_secdatak_check and vb2api_secdatak_create had headers in 2api.h, but no definitions. Merge identical internal/external functions: vb2api_secdata_create, vb2_secdata_create_crc vb2api_secdata_check, vb2_secdata_check_crc vb2api_secdatak_create, vb2_secdatak_create_crc vb2api_secdatak_check, vb2_secdatak_check_crc BUG=b:124141368, chromium:972956 TEST=make clean && make runtests BRANCH=none Change-Id: I64a14d65e5d856ca0f819ef3ded50b4719abc8b3 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1652874 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org>
* vboot: add OWNERS fileJoel Kitching2019-06-131-0/+4
| | | | | | | | | | | | BUG=chromium:967968 TEST=None Change-Id: Ibcf67c87d7a942494f9e898b20e5485fdba1093f Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1634090 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Sean Abraham <seanabraham@chromium.org>
* vboot: rewrite GBB functions and APIJoel Kitching2019-06-0721-280/+662
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old vboot1-style GBB accessor functions were awkwardly located within region-init.c. Rewrite GBB accessor functions for vboot2, and formally expose HWID retrieval function via vboot2 API. workbuf is used for key retrieval functions, while a buffer provided by the caller is used for HWID retrieval function. Reintroduce vboot_display_tests to `make runtests` test suite. Move GBB tests from vboot_display_tests to vb2_gbb_tests. Properly propagate vb2_workbuf objects within the function call stack (vb2_load_partition). BUG=b:124141368, chromium:954774 TEST=Build and flash to eve, check that Chrome OS boots TEST=Build with CL:1627469 applied, check HWID TEST=make clean && make runtests BRANCH=none Change-Id: I398d1329f0b092de35aac73d98dfd9aee6e4e7de Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1584488 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Jason Clinton <jclinton@chromium.org>
* vboot: don't unset VB2_NV_DISPLAY_REQUEST in EC syncJoel Kitching2019-06-073-42/+9
| | | | | | | | | | | | | | | | | | | | | | VB2_NV_DISPLAY_REQUEST disabling code has been relocated to VbBootNormal. Remove from EC sync code. Remove the vb2_shared_data argument from check_reboot_for_display. Avoid calling ec_sync_check_aux_fw after phase 1 if already certain that a reboot is required. BUG=b:124141368, chromium:948592, chromium:967298 TEST=make clean && make runtests BRANCH=none Change-Id: Ia5472aceb0b2a415f24dd76d26179632009d07cb Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1634453 Commit-Queue: Jason Clinton <jclinton@chromium.org> Tested-by: Jason Clinton <jclinton@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>