summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* vboot/ui: Add tests for to_dev transition flowfirmware-endeavour-13259.BHsuan Ting Chen2020-05-303-32/+320
| | | | | | | | | | | | | | | | | Unit tests paired with CL:2168072. BUG=b:146399181, b:156448738 TEST=make clean && make runtests TEST=make clean && DETACHABLE=1; make runtests TEST=make clean && PHYSICAL_PRESENCE_KEYBOARD=1; make runtests BRANCH=none Cq-Depend: chromium:2214457 Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: Ic6b109c514e1582d7eb29040135aeaa884b243be Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2198274 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* vboot/ui: Synchronize mock inputs for vb2_ui_testsHsuan Ting Chen2020-05-301-26/+28
| | | | | | | | | | | | | | | | | | | | | | | | We have two different mock inputs currently, and soon to be three. Since the input-solving order should not be strictly defined, it is difficult to write complicated scenarios under current approach. We cannot make sure if the ui_loop implementation exits earlier and ignores certain mock inputs. This CL synchronizes mock inputs with an iteration counter. We can write detailed scenarios by assigning the inputs iter-by-iter. BUG=b:146399181, b:156448738 TEST=make clean && make runtests TEST=make clean && DETACHABLE=1; make runtests TEST=make clean && PHYSICAL_PRESENCE_KEYBOARD=1; make runtests BRANCH=none Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: Ia839a6614eb0453b9f64075298a89a2db59d4070 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2217532 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* vboot: have consistent output for testing macrosYu-Ping Wu2020-05-291-44/+39
| | | | | | | | | | | | | | Extract print_passed() and print_failed() from test_eq(), and use them consistently in all testing functions in test_common.h. BRANCH=none BUG=none TEST=make runtests Change-Id: I1d4dbf13c9ae1a8130ea7af2733044d0556fa974 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2217547 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: do not request recovery for VB2_REQUEST_* from VB2_TRY()Yu-Ping Wu2020-05-294-153/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the returned value is not an error (such as VB2_REQUEST_*), do not call vb2api_fail() from VB2_TRY() to request recovery. During EC sync, instead of explicitly setting VB2_NV_RECOVERY_REQUEST in nvdata to request recovery, utilize vb2api_fail() instead to try the other AP slot before giving up on EC sync and going into recovery. In addition, remove the retry of EC RO sync for the following reasons. EC sync rarely fails, and even if it does, it's not very likely to be a transient problem that disappears on the next attempt. Besides, the RO sync is just a debug feature that only people who have a servo attached and can manually reflash should be using. Therefore, the retry is removed and hence we no longer need to restore the recovery request in nvdata. BRANCH=none BUG=chromium:1075488 TEST=make runtests Change-Id: I9ad8e5e0886679a9a342449553170317b010237b Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2145272 Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* trivial: fix spelling in add_loem_keys.shGeorge Engelbrecht2020-05-291-1/+1
| | | | | | | | | | | | | | | | ...also inflate my personal CL stats. BUG=None TEST=None BRANCH=master Signed-off-by: George Engelbrecht <engeg@chromium.org> Change-Id: I4af2d8b2aa42b4e6d4d4ea36a6ca73a340aa4814 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2220336 Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: George Engelbrecht <engeg@google.com> Tested-by: George Engelbrecht <engeg@google.com> Auto-Submit: George Engelbrecht <engeg@google.com>
* vboot: fix two return values in vboot_api_stub.cJoel Kitching2020-05-281-3/+4
| | | | | | | | | | | | | | | Also add the 2api.h include for vboot2-style stubs. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Id6522ea139126adce6cee5ba225ab3eb78f31b7e Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2218539 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* vboot: create VB2_ERROR_EX_SET_VENDOR_DATAJoel Kitching2020-05-281-7/+3
| | | | | | | | | | | | | | | | | Create VB2_ERROR_EX_SET_VENDOR_DATA error code for use in VbExSetVendorData callback. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Cq-Depend: chromium:2218538 Change-Id: I9d75a608185e475837d9cb4a53b943fd2dae6438 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2218537 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: move PERIPHERAL_BUSY to vboot2 namespaceJoel Kitching2020-05-281-2/+3
| | | | | | | | | | | | | | | | | Move VBERROR_PERIPHERAL_BUSY to vboot2 namespace as: VB2_ERROR_EX_AUXFW_PERIPHERAL_BUSY BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: Iebc7d73e3a87a8bd4d999be56ad23d6b77d9785c Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:2158865 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2158512 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* vboot: move timer and beep functions to vboot2 namespaceJoel Kitching2020-05-2820-177/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move these functions from vboot_api.h into 2api.h: VbExGetTimer --> vb2ex_mtime (usec -> msec) VbExSleepMs --> vb2ex_msleep VbExBeep --> vb2ex_beep Rename the constants: VB_USEC_PER_MSEC --> VB2_USEC_PER_MSEC VB_MSEC_PER_SEC --> VB2_MSEC_PER_SEC Remove the constant VB_USEC_PER_SEC. The error code VBERROR_NO_BACKGROUND_SOUND is dropped since it is not currently used. Update a few printf lines to use VB2_DEBUG instead. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: I887112ffd5f68fb6a9c4d9ad624aa420cbd55b4b Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:2158665 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2158666 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot/ui: return error if booting from internal failedYu-Ping Wu2020-05-271-5/+1
| | | | | | | | | | | | | | | | When booting from internal disk failed, return error and request recovery. This behavior is consistent with legacy UIs, and is necessary for FAFT firmware_CorruptBothKernelAB.dev to pass. BRANCH=none BUG=b:146399181, b:156880836 TEST=make runtests TEST=firmware_CorruptBothKernelAB.dev passed on puff Change-Id: Id927961ec7fa1788ddd817c133b5bc905b1e8335 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2213210 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot/ui: map Ctrl+S to the TO_NORM screenJoel Kitching2020-05-271-0/+2
| | | | | | | | | | | | | | | | Add hotkey to simplify FAFT mode_switcher for new Groot UI. BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: I91e00c5365c8f5a587786ab7dcfa67765a342824 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2213384 Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* vboot/ui: stop centralizing keyboard input actionsJoel Kitching2020-05-275-157/+127
| | | | | | | | | | | | | | BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: Ia63537fb13be5f04ae81a6be7e0fac6eaf47cfb7 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2210017 Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* vboot/ui: improve menu navigation docstringsJoel Kitching2020-05-276-110/+172
| | | | | | | | | | | | | | BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: I8cd47503384a8b8f48ccbc12fa6f24c71d02b755 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2210016 Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* image_signing: Activate file hash cache for watchlist service for signed builds.Yury Khmel2020-05-271-1/+4
| | | | | | | | | | | | | | | This follows the logic introduced in crrev.com/i/2523754 BUG=b:148229706 TEST= ./sign_official_build.sh usb source_image \ ~/trunk/src/platform/vboot_reference/tests/devkeys out_image BRANCH=None Cq-Depend: chrome-internal:3022044 Signed-off-by: Yury Khmel <khmel@google.com> Change-Id: I5398a9ea2984f0be11cb512f845507309d5f8f8e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2210771 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vboot/ui: Fix to_dev action initialization errorHsuan Ting Chen2020-05-262-3/+7
| | | | | | | | | | | | | | | Add an entry storing previous status of physical presence button to vb2_ui_context and reset it when recovery_to_dev_init is called. BUG=b:146399181,b:157390248 TEST=make clean && make runtests BRANCH=none Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: Ia0294a189713f1f99db7309937ea80ff90849bd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2214457 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* vboot: fix vboot_api_kernel4_tests to work with LEGACY_MENU_UI=1Joel Kitching2020-05-251-2/+23
| | | | | | | | | | | | | | | | | Set FWMP to "initialized" to make accesses work, and also implement the "Menu" variant of UI mock functions. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: I50d787c88a9682878ae7e6fe3f3e7a0578757d74 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2112396 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* vboot: reshuffle legacy UI filesJoel Kitching2020-05-2516-293/+255
| | | | | | | | | | | | | | | | | | | | | | | | | - Use "vboot_ui_legacy" prefix for all legacy UI-related files. - Merge vboot_display.{c,h} and vboot_ui_legacy_common.c into vboot_ui_legacy.{c,h}. - Move VbDisplayScreen and VbDisplayMenu implementation into their respective vboot_ui_legacy_*.c files. - Update VbCheckDisplayKey to take |screen| argument to avoid reading disp_current_screen global variable. BUG=b:124141368, chromium:968464 TEST=make clean && make runtests BRANCH=none Change-Id: I777551e4968ca22282901d22a262a8f2ec849702 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:2214615 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2112322 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot/ui: Refine mock functions in UI testsHsuan Ting Chen2020-05-253-175/+189
| | | | | | | | | | | | | | | | | Rearrange and split some action tests. Rewrite mock_ui_context related functions, and allow change_screen to change to real screens in vb2_ui_action_tests.c. BUG=b:146399181 TEST=make clean && make runtests TEST=make clean && DETACHABLE=1; make runtests BRANCH=none Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: I1692c9fcdf19073f8a9810dfab769df4c87224a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2209780 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* image_signing: remove firmware_boot.shJack Rosenthal2020-05-221-101/+0
| | | | | | | | | | | | | | | | | | This script was added in CL:2618. There's no references to it, and I can't find any evidence to it being documented anywhere or anyone using it. Let's remove it to see if anyone uses it. BUG=chromium:1083510 BRANCH=none TEST=emerge vboot_reference Change-Id: I6c307d3b9f7ee4c12153baf5fcd97c98badefe7b Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2212646 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vboot/ui: move invalid_disk_last into vb2_context_uiJoel Kitching2020-05-225-71/+45
| | | | | | | | | | | | | BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: I055499580325a43dcba3e1d037bac60deff30af8 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2210015 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* image_singing: remove align_rootfs.shJack Rosenthal2020-05-221-150/+0
| | | | | | | | | | | | | | | | No references to this. From commit history looks to be something Mario-only? Remove it and let's see where that goes... BUG=chromium:1085310 BRANCH=none TEST=emerge vboot_reference Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I7621d4673a09b85f59cdc69de1652e0b72ca1862 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2211957 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* image_signing: remove unpack_firmwarefd.sh scriptJack Rosenthal2020-05-221-69/+0
| | | | | | | | | | | | | | | | | | Looks like an old script from Mario. Won't run on modern chromebooks anyway. Not installed on any devices. BUG=chromium:1084003,chromium:1085310 BRANCH=none TEST=emerge vboot_reference Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I4b68183bc9bc943f273630cf12c52801a74df5be Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2210762 Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* image_signing: remove tofactory.sh scriptJack Rosenthal2020-05-221-179/+0
| | | | | | | | | | | | | | | | | | | Looks like this was an old script meant to be run on Mario. It's currently installed in the SDK only (not on the DUT), where it won't even operate anyway. I can't find any references to the script, aside from some old Mario documentation. BUG=chromium:1084003,chromium:1085310 BRANCH=none TEST=emerge vboot_reference Change-Id: I0b0bd22912170e62390e7ee1a62ef466b2ea1a7c Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2210761 Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vboot/ui: standardize shutdown_required function signatureJoel Kitching2020-05-206-50/+70
| | | | | | | | | | | | | | | | Stardardize to match that of a UI action function. Also move power_button global into vb2_ui_context object. BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: I59eb3b4dbd2f4a5630e8cceaef256ff93579c965 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2192864 Reviewed-by: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: Add recovery reason code for CSE Lite SKU errorsSridhar Siricilla2020-05-182-0/+8
| | | | | | | | | | | | | | Add Intel CSE Lite SKU error code to the recovery reason code list. Further, use recovery subcodes to indicate specific CSE Lite SKU errors. The recovery subcodes have been defined in the coreboot cse common lib. BUG=b:153520354 Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.corp-partner.google.com> Change-Id: Id24c06452d349306804ee5b0b93a6abc3fe3bdbc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2148557 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org>
* vboot/ui: hide phone recovery flow when disabledJoel Kitching2020-05-183-2/+20
| | | | | | | | | | | | | | | | | | | If phone recovery flow is disabled according to vb2api_phone_recovery_enabled(), then hide the "Recovery using phone" menu item from the RECOVERY_SELECT screen. BUG=b:146399181, b:147744345 TEST=make clean && make runtests TEST=Upgrade secdata_kernel to v1, boot to recovery mode, check menu BRANCH=none Change-Id: Id2d23b5a1cc31dec12befa60a9a52790b129495c Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2201056 Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: move VbExGetLocalizationCount to vboot2Joel Kitching2020-05-186-30/+26
| | | | | | | | | | | | | | | | | Rename VbExGetLocalizationCount to vb2ex_get_locale_count. Change signature to return by value instead of by parameter. BUG=b:146399181, b:156070974 TEST=make clean && make runtests BRANCH=none Change-Id: I4e3986007034724f01c9d42a382398ddacd59f33 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:2190612 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2193151 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* vboot/ui: add developer and to_norm screensJoel Kitching2020-05-187-95/+335
| | | | | | | | | | | | | | | | Developer mode can boot internal or external disk. Support for booting legacy firmware ("Ctrl+L") will be added in a subsequent CL. BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: I45590e20727bd84375d10ca5ef906206d0ecd805 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2192863 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: make dev boot target functions consistentJoel Kitching2020-05-182-1/+37
| | | | | | | | | | | | | | | | | | | | | vb2_get_dev_boot_target() should only return: BOOT_USB iff vb2_dev_boot_usb_allowed() BOOT_LEGACY iff vb2_dev_boot_legacy_allowed() Otherwise, fallback to BOOT_DISK. BUG=None TEST=make clean && make runtests BRANCH=none Change-Id: Ic67915d0888f640f6e7b04c91f99346412cc18ee Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2203301 Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* updater: Replace servo-v2 with google-servo-v2Nicolas Boichat2020-05-181-1/+1
| | | | | | | | | | | | | | servo-v2 will eventually be deprecated. BRANCH=none BUG=b:145175076 TEST=Flash with servo v2, no more "Warning: Use 'google-servo-v2' instead!" Change-Id: Ie7ae9e173a7cbe0fcd37d1c88b5746fb89cc8e22 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2206094 Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* vboot: Add language selection screen to vb2_screenstabilize-quickfix-13099.93.Bstabilize-13099.94.Bstabilize-13099.90.Bstabilize-13099.85.Bstabilize-13099.73.Bstabilize-13099.72.Bstabilize-13099.70.Bstabilize-13099.118.Bstabilize-13099.110.Bstabilize-13099.101.Brelease-R84-13099.Bfactory-test-13099.17.BYu-Ping Wu2020-05-151-0/+2
| | | | | | | | | | | | Add VB2_SCREEN_LANGUAGE_SELECT to enum vb2_screen. BRANCH=none BUG=b:146399181 TEST=USE="menu_UI" emerge-nami depthcharge Change-Id: I441e5dd65c8c1f91ec868d3ab477b61b0c3e9cc5 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2200577
* vboot/ui: Split UI testsHsuan Ting Chen2020-05-144-567/+751
| | | | | | | | | | | | | | | | | | Rearrange UI tests into three files: vb2_ui_utility_tests for utility functions and core UI functions, vb2_ui_action_tests for hooked actions, and vb2_ui_tests for UI entries. This CL does not add any extra tests. BRANCH=none BUG=b:156448738 TEST=make clean && make runtests TEST=make clean && DETACHABLE=1; make runtests Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: I36a0a43aa3295b06cf32446dcc107652d64d2b8f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2198268 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: enable phone recoveryYu-Ping Wu2020-05-142-5/+5
| | | | | | | | | | | | | Enable the phone recovery functionality and UI. BRANCH=none BUG=b:153596126 TEST=make runtests Change-Id: If4fc29db44903e79cecd959a9b558c509ad19e1a Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2196093 Reviewed-by: Joel Kitching <kitching@chromium.org>
* 2sha: Add SHA-224 and SHA-384 hash algorithmsJulius Werner2020-05-129-31/+173
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the SHA-224 and SHA-384 hash algorithms, which are basically just variants of SHA-256 and SHA-512 (respectively) with different initialization vectors and truncating a bit of the final output. They are only added to serve vboot's role as all-purpose crypto toolbox for callers (e.g. coreboot, where I need SHA-384 to support a certain SoC boot descriptor right now) and not intended for actual use as signature or firmware body hashes -- therefore, we only add the hash algorithms themselves and don't create enum values for them in enum vb2_crypto_algorithm or other structures. Also clarify the difference between UNROLL_LOOPS and UNROLL_LOOPS_SHA512 in the Makefile, since it was totally not obvious to me. BRANCH=None BUG=None TEST=make runtest and make runtest UNROLL_LOOPS=1 Cq-Depend: chromium:2191082 Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: Ic132d4dfe5967f03be4666b26c47d32c1235f4a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2183551 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot/ui: implement advanced_optionsJoel Kitching2020-05-111-6/+31
| | | | | | | | | | | | | | | Implement advanced_options menu item and screen. BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: I870133db74d773771ea92a280fdfb4864706bd71 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2186958 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: Platform name check should be case insensitiveHung-Te Lin2020-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | Some platforms (e.g., Zork) may decide to change platform name from lower_case to CamelCase after early builds, and platform name check will be an AU blocker in that case. Considering there should be no devices having same name (and using incompatible firmware), it should be fine to change the strncmp to strncasecmp so the platform name check will be case insensitive. BUG=b:156119908 TEST=make runtests BRANCH=None Change-Id: I5014c136976454dd0965a607e5a98bbe4543a41e Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2192537 Commit-Queue: Rob Barnes <robbarnes@google.com> Tested-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Rob Barnes <robbarnes@google.com>
* futility: Adds platform check quirk for zorkRob Barnes2020-05-113-0/+33
| | | | | | | | | | | | | | | | | | | | | | Adds a quirk for futility on zork boards. Zork boards before 13073 used lowercase for the firmware names which causes the compatible platform check fail. This adds the disable_compatible_platform_check quirk and enables it by default for zork boards. BUG=b:156119908, b:155941790 TEST=flashed Google_trembyle.13066.0.0 using servo chromeos-firmwareupdater --force rebooted and confirmed Google_Trembyle.13073.0.0 was flashed BRANCH=none Change-Id: I6fc6bf5bb42b725b5e7c9d0166f945b9c123bab4 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2191089 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Eric Peers <epeers@google.com> Commit-Queue: Edward Hill <ecgh@chromium.org>
* vboot: Add developer screens to vb2_screenYu-Ping Wu2020-05-091-0/+4
| | | | | | | | | | | | | Add VB2_SCREEN_DEVELOPER_MODE and VB2_SCREEN_DEVELOPER_TO_NORM to enum vb2_screen. BRANCH=none BUG=b:146399181 TEST=USE="menu_ui" emerge-nami depthcharge Change-Id: Ie949eedbf5d564f73fd6288bbc3630af83335dbb Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2186571 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot/ui: implement to_dev transition flowJoel Kitching2020-05-076-23/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce three new action hooks: - vb2_screen_info.init Init function runs once when changing to the screen. - vb2_screen_info.action Action function runs repeatedly while on the screen. - vb2_menu_item: Action function takes precedence over target screen if non-NULL. Create the VB2_SCREEN_RECOVERY_TO_DEV screen, and add a keyboard shortcut to get to that screen directly when in manual recovery mode: Ctrl+D. The TO_DEV screen repeatedly checks for the correct physical verification state. When that state is triggered, it switches to dev mode and reboots. The trigger depends on physical presence type: - PHYSICAL_PRESENCE_KEYBOARD: wait for ENTER key on the confirm button, pressed by internal keyboard - !PHYSICAL_PRESENCE_KEYBOARD: wait for the physical presence button (recovery or power) to be pressed and released - SPACE character also cancels in order to preserve prior behaviour Note that currently there is no way to exit developer mode once it has been enabled. BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: If3ff248d98859d530c3a24524618c6282a5ac5b5 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2168072 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* vboot/ui: remove validate_selection functionJoel Kitching2020-05-073-93/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | Given that we are sending the full vb2_ui_context into UI-related functions, it's impossible to fully validate that called functions don't modify UI state in unexpected ways. Assume UI-related functions are mutating vb2_ui_context data correctly. Screen init functions (see CL:2168072) will be used to set selected_item and disabled_mask before displaying a screen for the first time. change_screen() is also changed to return a vb2_error_t value to be more consistent with action functions. BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: Icda68f95a835b9143b8dd085d8dbdb7bced04775 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2182084 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* vboot: Rename VB_AUX_FW_* to VB2_AUXFW_*factory-drallion-13080.BYu-Ping Wu2020-05-058-59/+59
| | | | | | | | | | | | | | For naming consistency, rename any variations of "AUX_FW" to "auxfw". BRANCH=none BUG=none TEST=make runtests Cq-Depend: chromium:2154265 Change-Id: Icf74215f5babf19228f2f362c3c29c9b14794dfc Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2154266 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot/ui: move locale_id from screen_state into ui_contextJoel Kitching2020-05-054-67/+57
| | | | | | | | | | | | | | | | | locale_id is not tied to the current screen -- i.e. it shouldn't revert if we return to the previous screen. BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: I691bdf7938d2a14cfbe68c7f60dc0103c236733c Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2182083 Tested-by: Hsuan Ting Chen <roccochen@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot/ui: initialize vb2_ui_context memory to 0Joel Kitching2020-05-051-0/+1
| | | | | | | | | | | | | | | | Members of vb2_ui_context are undefined unless initialized. memset() the entire struct to 0 initially. BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: Ieeb77c576231c4a4afb204e47983e35916be8fe4 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2182082 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: Remove reboot-related vboot1-style errorsYu-Ping Wu2020-05-051-13/+2
| | | | | | | | | | | | BRANCH=none BUG=b:124141368, chromium:988410 TEST=make runtests Cq-Depend: chromium:2154269, chromium:2175864 Change-Id: Ib3996ecc83a69ce6780d48f1aa446e81dfd75589 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2167622 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: Add advanced options screen to vb2_screenYu-Ping Wu2020-05-051-0/+2
| | | | | | | | | | | | | Add VB2_SCREEN_ADVANCED_OPTIONS to enum vb2_screen. BRANCH=none BUG=b:146399181 TEST=USE="menu_ui" emerge-nami depthcharge Change-Id: I14f96f870c5f2f7dc462dfd138d4466b3e99d74c Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2175720 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: fix up EC/auxfw sync includesJoel Kitching2020-05-053-12/+6
| | | | | | | | | | | | | BUG=b:124141368, chromium:1016688 TEST=make clean && make runtests BRANCH=none Change-Id: Iabf62e4df5e554da28b191878b76d926299d73b9 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2171544 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: Implement common UI loopHsuan Ting Chen2020-05-048-70/+1718
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add config DETACHABLE to control the navigation in menu UI. Implement 4 screens: - VB2_SCREEN_RECOVERY_SELECT - VB2_SCREEN_RECOVERY_INVALID - VB2_SCREEN_RECOVERY_PHONE_STEP1 - VB2_SCREEN_RECOVERY_DISK_STEP1 Handling user inputs. - Shutdown request through VbExIsShutdownRequested. - Navigate with up, down, and enter key. - Navigate with volume up, volume down, and power button in DETACHABLE. Implement common UI loop, currently used for manual and non-manual recovery (developer forthcoming). BRANCH=none BUG=b:146399181 TEST=USE="menu_ui" emerge-nami depthcharge TEST=USE="menu_ui detachable" emerge-nami depthcharge TEST=make clean && make runtests TEST=DETACHABLE=1; make clean && make runtests Cq-Depend: chromium:2152212 Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: I4e0f2cdf053f75935529826df215b06c8a9af4cc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2117810 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* vboot: fix a typo in CL:2112321stabilize-13070.BJoel Kitching2020-04-301-1/+1
| | | | | | | | | | | | | | | | | CL:2112321 inadvertently removed the escape on a \n newline in a VB2_DEBUG string. Put it back. BUG=b:124141368, chromium:968464 TEST=make clean && make runtests BRANCH=none Change-Id: I19ee4a77d3cc58d6995212151b381ae76c602a42 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2174039 Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* 2crypto: Force correct section flags for .rodata arraysJulius Werner2020-04-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up fix to CL:2157900. That CL put the problematic arrays into sections with the right name, but they still didn't set the right ELF flags for them (specifically the READONLY flag). This made the assembler unhappy in coreboot, although it still seems to have built things correctly in the end: {standard input}: Assembler messages: {standard input}:359: Warning: setting incorrect section attributes for .rodata.vb2_hash_names {standard input}:369: Warning: setting incorrect section attributes for .rodata.vb2_sig_names This patch throws more ugly hacks at the problem to make it disappear. BRANCH=None BUG=None TEST=Build coreboot for both Arm and x86 boards, confirmed that error messages are gone and objdump shows intended section flags. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: Iea93788a13e9fd14d6b5a16626294d5a4b0e5411 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2169480 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: Convert reboot-related errors to vboot2-styleYu-Ping Wu2020-04-2814-199/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error codes are renamed as follows: VBERROR_SHUTDOWN_REQUESTED --> VB2_REQUEST_SHUTDOWN VBERROR_REBOOT_REQUIRED --> VB2_REQUEST_REBOOT VBERROR_EC_REBOOT_TO_SWITCH_RW --> VB2_REQUEST_REBOOT_EC_SWITCH_RW VBERROR_EC_REBOOT_TO_RO_REQUIRED --> VB2_REQUEST_REBOOT_EC_TO_RO VBERROR_KEEP_LOOPING --> VB2_REQUEST_UI_CONTINUE Since these are not really "errors", they're renamed to VB2_REQUEST_* instead, with larger values to separate from real errors. The old vboot1-style errors will be removed once the errors are renamed in coreboot and depthcharge. BRANCH=none BUG=b:124141368, chromium:988410 TEST=make runtests Change-Id: Ide1328f9c0f2803534fb3f1f1ecd16ad8ea36a4e Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2143030 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>