summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix arch detection for i686stabilize-9901.35.BPaul Kocialkowski2017-08-311-0/+2
| | | | | | | | | | | | | | | | | This adds detection for the i686 arch and replaces it with x86, allowing it to build. BRANCH=none BUG=none TEST=Build host_stuff on an i686 machine Change-Id: Idab7c762a7fbb97ec5318b9aa860756b4dd0bc25 Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: https://chromium-review.googlesource.com/645086 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
* image_signing: Don't create empty keyset subdirC Shapiro2017-08-301-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | updater4.sh uses the /keyset subdir from the firmware updater shellball to indicate if it should use model specific keys or not. This won't work for any case where the signers haven't been updated with model specific keys yet. Changed the output for unibuilds to be consistent with non-uni builds where the /keyset subdir won't be created if loem.ini doesn't exist on the signer. BUG=b:65128657 TEST=crrev.com/c/626718 and crrev.com/c/636344 test cases, which cover both the shared and non-shared key use cases BRANCH=None Change-Id: I38db1385fa99ac4a9843a750c336c58b74b127b4 Reviewed-on: https://chromium-review.googlesource.com/642031 Commit-Ready: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Tested-by: C Shapiro <shapiroc@google.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jason Clinton <jclinton@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vb21_common2_tests: Free keyb_dataNicolas Boichat2017-08-271-0/+1
| | | | | | | | | | | | BRANCH=none BUG=b:64854892 TEST=make runlongtests Change-Id: I22d0c6e55afde6ece9535591f94ec07280ae2b12 Reviewed-on: https://chromium-review.googlesource.com/633966 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* [unibuild] Fix issues with model specific fw signC Shapiro2017-08-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Updated the current coral config to use the fake keys from the loemkeys dev keyset (ACME) and then tested/debugged this flow based on that config. Fixed issue where key_id wasn't eval'd in bash when it was passed to grep because it has ' quotes around it. BUG=b:64842314 TEST=~/trunk/src/platform/vboot_reference/scripts/image_signing/sign_official_build.sh recovery ../build/images/coral/R62-9877.0.2017_08_25_1030-a1/recovery_image.bin ../platform/vboot_reference/tests/loemkeys coral_loem_signed_recovery.bin BRANCH=None Change-Id: I50a58e512e9a83dc2707951f12d709f9006d67ca Reviewed-on: https://chromium-review.googlesource.com/636344 Commit-Ready: C Shapiro <shapiroc@google.com> Tested-by: C Shapiro <shapiroc@google.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* image_signing: sign_official_build.sh: Add version to rwsig signaturesNicolas Boichat2017-08-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | We would like to have different signature versions for hammer (1=dev, 2=premp, 3=mp), so we should pass --version to futility. The default version stays 1. BRANCH=none BUG=b:35587169 TEST=openssl genrsa -3 -out key_hammer.pem 2048 futility create --desc="Hammer fake MP key" key_hammer.pem key_hammer echo firmware_version=2 > key_hammer.version ../vboot_reference/scripts/image_signing/sign_official_build.sh \ accessory_rwsig build/hammer/ec.bin . \ ec-signed.bin key_hammer.version futility show ec-signed.bin => Version: 0x00000002 TEST=Without passing a version file, version is still 1. ../vboot_reference/scripts/image_signing/sign_official_build.sh \ accessory_rwsig build/hammer/ec.bin . ec-signed.bin futility show ec-signed.bin => Version: 0x00000001 Change-Id: I0cd9133404fb0d827bd2f0d3bcc71d5dd274734d Reviewed-on: https://chromium-review.googlesource.com/631757 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vb21_common2_tests: Fix test for exponent 3 keysNicolas Boichat2017-08-241-6/+25
| | | | | | | | | | | | | | | | | | | | | vb2_public_key_read_keyb cannot be used for VB2.1 public keys (especially not for 2048 exponent 3 or F4, as their size is the same so the algorithm cannot be guess). Instead, do what futility/rwsig does and derive the public key from the private RSA key. BRANCH=none BUG=b:64854892 TEST=make runlongtests Change-Id: Ie81f40e6076cd0c234012b9af58e39425f8b717c Signed-off-by: Nicolas Boichat <drinkcat@google.com> Reviewed-on: https://chromium-review.googlesource.com/628177 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Caveh Jalali <caveh@google.com>
* tests: Add support for exponent 3 keysCaveh Jalali2017-08-245-23/+65
| | | | | | | | | | | | BRANCH=none BUG=b:64854892 TEST=make runlongtests Change-Id: I827ce47b68339dc4df7f84b26a0b6643af27037b Signed-off-by: Caveh Jalali <caveh@google.com> Reviewed-on: https://chromium-review.googlesource.com/628176 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org>
* Add support for IFX FieldUpgradeInfoRequest2 commandMattias Nissler2017-08-2310-0/+262
| | | | | | | | | | | | | | | | Add tpm_lite library support for the IFX specific TPM_FieldUpgrade subcommand "FieldUpgradeInfoRequest2". Expose this via tpmc so it can be used from shell scripts. BRANCH=none BUG=chromium:728130 TEST=Builds and tpmc ifxfieldupgradeinfo prints plausible results. Change-Id: Ie58ebccef7fe90f7fca65d7cd9c78e1f16f9f29a Reviewed-on: https://chromium-review.googlesource.com/562772 Commit-Ready: Mattias Nissler <mnissler@chromium.org> Tested-by: Mattias Nissler <mnissler@chromium.org> Reviewed-by: Mattias Nissler <mnissler@chromium.org>
* [unibuild] Support for unibuild firmware signingC Shapiro2017-08-231-1/+95
| | | | | | | | | | | | | | | | | | | | | | | | For design context, see go/cros-unibuild-signing This adds support for multiple, shared firmware images from a unified build that needs to be signed with different OEM specific keys. It uses a signer_config.csv file (that is generated by pack_firmware.py) to determine which images need to be signed with which keys. BUG=b:64842314 TEST=./build_image --board=coral dev && ./mod_image_for_recovery.sh --board=coral && ~/trunk/src/platform/vboot_reference/scripts/image_signing/sign_official_build.sh recovery ../build/images/coral/latest/recovery_image.bin ../platform/vboot_reference/tests/devkeys BRANCH=None Change-Id: Id3711bbe73dfe652184bc046b5f642c30b8d1627 Reviewed-on: https://chromium-review.googlesource.com/626718 Commit-Ready: C Shapiro <shapiroc@google.com> Tested-by: C Shapiro <shapiroc@google.com> Reviewed-by: C Shapiro <shapiroc@google.com>
* detachables: Display recovery insert icon at recovery startupShelley Chen2017-08-211-8/+28
| | | | | | | | | | | | | | | | | | | | | When user first starts up recovery (3 finger salute), display usb insert instructions and original insert graphic until user starts pushing volume buttons. If the user pushes power button during while the icon is displayed (no menu items), device will shut down (this is to accomodate users that accidentally enter the recovery screen and want to exit quickly). Upon user pressing the volume buttons, the insert icon will disappear and user will see the menu items and be able to scroll up/down. BUG=b:64400325 BRANCH=None TEST=boot into recovery. Make sure graphic shown until start pushing volume buttons. Change-Id: I4a5001271a0b84d1237d4bbc6a098afa10cb9372 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/617600 Reviewed-by: Julius Werner <jwerner@chromium.org>
* ec_sync: always call VbExUpdateAuxFwCaveh Jalali2017-08-212-12/+21
| | | | | | | | | | | | | | | | | | | | | | call VbExUpdateAuxFw() uncontidionally, instead of when we know we need to do an update. Vb*AuxFw() already maintains state, so this doesn't change when we (attempt) to update firmware. however, this does allow us to iterate over all firmware drivers to call their .protect() method. previously, we would only call .protect() after an actual firmware update. updated unit tests to match the new logic. BRANCH=none BUG=b:35585700 TEST=verified i2c tunnels are protected on reef using ectool i2cprotect N status. Change-Id: I9244db28ed181f568d117092307293202257735b Signed-off-by: Caveh Jalali <caveh@google.com> Reviewed-on: https://chromium-review.googlesource.com/620281 Reviewed-by: Julius Werner <jwerner@chromium.org>
* lib/vboot_ui_menu: Consider volume buttons in vb2_update_selectionFurquan Shaikh2017-08-181-0/+2
| | | | | | | | | | | | | | | | | vb2_update_selection considered only KEY_UP and KEY_DOWN inputs to update the selection. This resulted in volume buttons not working on firmware screen to update the selection. Add volume buttons as valid inputs in vb2_update_selection. BUG=b:64839396 BRANCH=None TEST=Verified that volume buttons work on firmware screen. Change-Id: I08bfa91eafb170fb450649a2abaafe7f4d58e17b Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/621787 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Shelley Chen <shchen@chromium.org>
* detachables: Skip "Enable Developer Mode" in DEV modeShelley Chen2017-08-145-79/+128
| | | | | | | | | | | | | | | | | | | | When DUT is already in dev mode, don't let user select the "Enable Developer Mode" selection in the menu. Add disabled_idx_mask to VbExDisplayMenu API to allow for disabling of menu items in the future if needed. BUG=b:63078243, b:35585623 BRANCH=None TEST=reboot into recovery with DUT already in dev mode. Make sure can't scroll to "Enable Developer Mode: entry. reboot into recovery with DUT in normal mode. Make sure "Enable Developer Mode" entry is selectable. CQ-DEPEND=CL:565335 Change-Id: Ic71fe6aa2e41337787a0c2278f729356edb155fd Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/598430 Reviewed-by: Julius Werner <jwerner@chromium.org>
* image_signing: convert_recovery_to_ssd.sh: rewrite to be betterMike Frysinger2017-08-091-33/+22
| | | | | | | | | | | | | | | | | | | | This converts the script in one commit as nothing uses it directly, so the chances of it breaking overall build is low. - Convert to common.sh for more helpers - Convert echo to info - Convert to loopback devices to speed things up - Fix quoting in a few places - Drop cgpt usage since we use loopback partitions everywhere now BRANCH=None BUG=chromium:714598 TEST=running on an image still works Change-Id: I6608db77792502f35522a6f793ccd800fdd6af4e Reviewed-on: https://chromium-review.googlesource.com/505482 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* cgpt: prioritize: Make sure all headers/entries are validJeffy Chen2017-08-092-4/+7
| | | | | | | | | | | | | | | | | The prioritize cmd expected primary gpt header and entries are valid. Add a validity check to guarantee that. BUG=b:35585016 TEST=Check on bob, the secondary gpt still valid after these commands: dd if=/dev/zero of=/dev/mmcblk0 bs=512 count=64 cgpt prioritize /dev/mmcblk0 Change-Id: I853e25211a46fa3ce93cef1e5169b93b0a6430a9 Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Reviewed-on: https://chromium-review.googlesource.com/604814 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* image_signing: sign_official_build.sh: use loopbacks kernel configs w/boot ↵Mike Frysinger2017-08-031-16/+5
| | | | | | | | | | | | | | | | | | | loader updates This is the last place that uses grab_kernel_config. Convert it over to accessing the kernel directly via loopbacks and delete the helper function entirely. This avoids unnecessary copies and prevents any more code from using it. BRANCH=None BUG=chromium:714598 TEST=dump_config still works Change-Id: I16aa2c2568d15c43bb20b9d5dc18060915047506 Reviewed-on: https://chromium-review.googlesource.com/505481 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* detachables: Select power off after language selectionShelley Chen2017-08-011-3/+22
| | | | | | | | | | | | | | | | | | Set current selection to power off after exiting the languages menu. Previously, we were just defaulting to selecting the 0 index. However, this won't work anymore if we hide the "Enable Developer Mode" entry in the recovery menu due to that entry being at the 0th index. BUG=b:63078243, b:35585623 BRANCH=None TEST=Boot into recovery when machine in normal mode. Select languages menu, make language selection and make sure that when return to recovery menu, power off item is selected. Change-Id: I479c2270ca99197fd8c44386ab1ca4526ae7d64a Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/565527 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* detachables: Set fw screen timeout to 30 secs upon button pressShelley Chen2017-07-313-3/+14
| | | | | | | | | | | | | | | | | | | | For detachables, the short delay is to fast to them to read/choose options. Setting timeout to 30 seconds once user starts scrolling through the menu. If no action is taken by the user, will retain the short delay timeout. BUG=b:63056097, b:35585623 BRANCH=None TEST=reboot with gbb flag bit 1 enabled and ensure using short delay. reboot and press volume button and make sure using long delay. reboot and make sure short delay performed again upon reboot. reboot and make sure gbb flag bit 1 = 0 and make sure long delay still working as expected. Change-Id: I31e3ca8aff6b29abca70ca9587deae7f6443d837 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/563817 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* crossystem: Remove defunct sw_wpsw_boot fieldstabilize-9765.7.Bstabilize-9765.39.BJulius Werner2017-07-182-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | The sw_wpsw_boot field only ever worked correctly on some platforms. It also isn't used anywhere in the codebase (only other reference is a comment about how it doesn't always work in factory_installer.sh), and it's no longer clear what it was meant for in the first place (b/35510092 hints at needing it for some planned feature that was never implemented). Let's get rid of it to avoid confusing people. If userspace tools need to know the software write-protect state, they can instead run flashrom directly. For feedback reports, this output is already included in the "verified boot" section. BRANCH=none BUG=chromium:508269,chromium:742685 TEST=none Change-Id: I8975b1e2c8e604b4cb48d092c13b923b4db2d207 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/575389 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Implement tpmc getversion command.stabilize-9756.BMattias Nissler2017-07-1810-3/+151
| | | | | | | | | | | | | | | This command exposes the vendor and TPM firmware version. BRANCH=none BUG=chromium:728130 TEST=Builds and tpmc getversion prints plausible results. Change-Id: Iec556a298e025e10bda00121b40a25d8dc3839d1 Reviewed-on: https://chromium-review.googlesource.com/565287 Commit-Ready: Mattias Nissler <mnissler@chromium.org> Tested-by: Mattias Nissler <mnissler@chromium.org> Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* image_signing: sign_official_build.sh: use loopbacks for rootfs hash updatesMike Frysinger2017-07-151-24/+18
| | | | | | | | | | | | | | | This avoids copying GB of data for the rootfs & kernels by using loopback devices instead. BRANCH=None BUG=chromium:714598 TEST=dump_config still works Change-Id: I41cd71db3c567be811c4a59523c797c128a8e493 Reviewed-on: https://chromium-review.googlesource.com/505480 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* image_signing: sign_official_build.sh: use loopbacks for dump_configMike Frysinger2017-07-131-1/+2
| | | | | | | | | | | | | | | | This avoids copying out the kernels just to read their configs. Not super important as the signer doesn't use it, but we want to kill off the grab_kernel_config helper. BRANCH=None BUG=chromium:714598 TEST=dump_config still works Change-Id: I2533b1d4de6980120f277fea3a1d964cb4fbaf0d Reviewed-on: https://chromium-review.googlesource.com/505479 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* Update for openssl 1.1Daniel Kurtz2017-07-076-12/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL 1.1 has made significant non-backwards compatible changes to its API as outlined in: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes BRANCH=none BUG=chromium:738114 TEST=cros_workon --host start vboot_reference TEST=w/ openssl-1.0.2k: sudo emerge vboot_reference TEST=w/ openssl-1.1.0e: sudo emerge vboot_reference => both build ok $ futility version => command runs without error TEST=cros_workon --board=soraka start vboot_reference coreboot TEST=w/ openssl-1.0.2k: emerge-soraka vboot_reference coreboot TEST=w/ openssl-1.1.0e: emerge-soraka vboot_reference coreboot => All build ok Change-Id: I37cfc8cbb04a092eab7b0b3224f475b82609447c Reviewed-on: https://chromium-review.googlesource.com/557739 Commit-Ready: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* image_signing: sign_official_build.sh: use loopbacks when updating recovery ↵Mike Frysinger2017-07-061-15/+9
| | | | | | | | | | | | | | | | kernels This avoids copying in/out the kernels for their configs and to resign. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: Id13d5099da7f8a73ebd4d4e918188c7eb5b65a12 Reviewed-on: https://chromium-review.googlesource.com/505478 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* call depthcharge hooks for auxiliary FW update.Caveh Jalali2017-06-284-8/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this adds calls to depthcharge (using callbacks) to do auxiliary firmware updates. in particular, this is intended to trigger TCPC updates, but other programmables could also be updated. no firmware updates take place until a board file has actually registered a firmware update "driver". board file updates to follow. TEST="COV=1 make" passes. depthcharge boots on snappy. with additional follow-on CLs, we can update the ps8751. the companion depthcharge changes are here: https://chromium-review.googlesource.com/c/498150/ the working design doc is here: https://docs.google.com/a/google.com/document/d/1uzS0b3O3Us1QI2Sx7LDkjEfHmuhYB2BolrAoNwCVoc0/edit?usp=sharing these features depend on vboot API updates: CQ-DEPEND=CL:498150 BUG=b:35586896 BRANCH=none Change-Id: If0d634eab08b429a8e7e80f5fe11eab3705bba0f Signed-off-by: Caveh Jalali <caveh@google.com> Reviewed-on: https://chromium-review.googlesource.com/505260 Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* host lib: include <sys/types.h> for ssize_tstabilize-9693.BAlex Suykov2017-06-281-0/+1
| | | | | | | | | | | In uClibc neither <stdio.h> nor <strings.h> defines ssize_t. Change-Id: I7fb6a0f51eae76062784952beb42298c486461b5 Signed-off-by: Alex Suykov <alex.suykov@gmail.com> Reviewed-on: https://chromium-review.googlesource.com/320472 Commit-Ready: Stefan Reinauer <reinauer@google.com> Tested-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Stefan Reinauer <reinauer@google.com>
* Drop pre-vboot2 safe guardsStefan Reinauer2017-06-272-2/+0
| | | | | | | | | | | | | | Signed-off-by: Stefan Reinauer <reinauer@chromium.org> BRANCH=none TEST=sudo emerge vboot_reference BUG=none Change-Id: Id98347cc6d4fb79cc2caa103b83c4aec82f4ef6a Reviewed-on: https://chromium-review.googlesource.com/541584 Commit-Ready: Stefan Reinauer <reinauer@google.com> Tested-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* image_signing: sign_official_build.sh: switch initial image signing to loopbacksMike Frysinger2017-06-231-11/+16
| | | | | | | | | | | | | | | | | This changes the kernel config reading and the stateful vblock updating to use loopback devices. This avoids having to copy out the kernels many times over just to read them. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: Ibb49791a7db998e45b35ed15ddc12126e669c730 Reviewed-on: https://chromium-review.googlesource.com/505477 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org> Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
* cgpt: show: Print partition size with 64-bit formatErdi Chen2017-06-231-23/+25
| | | | | | | | | | | | | | | Partition size on 4TB drive can overflow 32-bit integers. Running "cgpt show /dev/sda" prints negative number for the state partition (sda1). BRANCH=none BUG=none TEST=Run "cgpt show /dev/sda" with 4TB drive. Change-Id: I56f3b43594028695745de8c5a1626d940a3b4c5b Reviewed-on: https://chromium-review.googlesource.com/546879 Commit-Ready: Erdi Chen <erdi@google.com> Tested-by: Erdi Chen <erdi@google.com> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* detachables: Fix language menu size in recoveryShelley Chen2017-06-221-4/+9
| | | | | | | | | | | | | BUG=b:35585623 BRANCH=None TEST=Reboot into recovery, scroll to language menu and make sure that you can scroll and select other languages. Change-Id: I6fe7f0550b05e33eaeef928cd23932f5a40fe9ad Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/544897 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* detachables: Highlight selection w/ Debug InfoShelley Chen2017-06-221-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Currently with detachable menu, when debug info is displayed, the current selection is not highlighted. Changing call in VbDisplayDebugInfo from VbDisplaySecreen to VbDisplayMenu to ensure selection is highlighted. This will have no effect on firmware screens for non-detachables. BUG=b:35585623 BRANCH=None TEST=Compile with and without USE=detachable_ui Reboot and display debug info. Make sure that for detachable menu, selection remains highlighted and for non-detachable screens, The screen displays as usual. Change-Id: I0a7a2c4e0ae3ffb82e13dc92a319288d4ccb3997 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/541758 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@google.com>
* Change invocation of "gbb_utility" to "futility gbb"Hung-Te Lin2017-06-2110-72/+73
| | | | | | | | | | | | | Replace commands using gbb_utility by the new 'gbb' futility command. BRANCH=none BUG=None TEST=USE=test emerge-$BOARD vboot_reference Change-Id: I8c1547d295a955373413482509a33964b0e0c06f Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/538442 Reviewed-by: Stefan Reinauer <reinauer@google.com>
* 2lib: Add test_mockable attributeRandall Spangler2017-06-203-0/+15
| | | | | | | | | | | | | | | | | | | | | | | Some tests mock library functions. This previously worked due to adding CFLAGS += -Xlinker --allow-multiple-definition to the test binaries. But the new version of binutils seems to need the default implementation to be weak if compiled with -O2 in some cases. Add test_mockable for use with functions where this is now needed. BUG=chromium:723906 BRANCH=none TEST=Add CFLAGS += -O2 to the makefile, then make -j runtests Tests break before this change with -O2, and work afterwards Change-Id: I95996a3e1086251442055765295a75de4c20ee3c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/527601 Commit-Ready: Manoj Gupta <manojgupta@chromium.org> Tested-by: Rahul Chaudhry <rahulchaudhry@chromium.org> Reviewed-by: Rahul Chaudhry <rahulchaudhry@chromium.org>
* Unified build support for multi-firmware signingC Shapiro2017-06-201-13/+36
| | | | | | | | | | | | | | | | | | | Unified builds break down multiple firmware images for each model; however, the signing script didn't have support for this. This updates the signing script to iterate over all models in a unified build and sign each firmware image separately. BUG=chromium:734485 TEST=sign_official_build.sh recovery for reef and reef-uni BRANCH=none Change-Id: Ia2b5b8bd36ac77aeb7944362186d1d5739e6ff3d Reviewed-on: https://chromium-review.googlesource.com/540131 Commit-Ready: C Shapiro <shapiroc@google.com> Tested-by: C Shapiro <shapiroc@google.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jason Clinton <jclinton@chromium.org>
* futility: Change 'gbb_utility' to sub command 'gbb'.Hung-Te Lin2017-06-201-2/+4
| | | | | | | | | | | | | | | | | | | | | 'gbb_utility' is the command name before it has been merged to futility. However, it's pretty long and redundant today if we have to type 'futility gbb_utility ...'. New features of futility are now implemented as sub-commands (futility cmd) instead of symlinks (for example, 'create', 'show', 'sign', 'verify') so it seems reasonable to just change gbb_utility to a sub-command style name 'gbb'. Meanwhile, for backward compatibility, the 'gbb_utility' name is still supported so symlinks will still work. BRANCH=none BUG=None TEST=emerge vboot_reference; futility gbb Change-Id: I4de59bcc564576420ab71157cb166fc8a42e85ad Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/538398 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* image_signing: sign_official_build.sh: switch verification to loopbacksMike Frysinger2017-06-151-10/+10
| | | | | | | | | | | | | | | | Rather than copy out the rootfs to a temp file and perform checks on that, run the checks directly on the image. This saves us from having to copy many GB worth of data which can be expensive on the VMs (slow disk I/O). BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: Ie7d1c432aacb69e57b6c5fd9ab810b8d0b054860 Reviewed-on: https://chromium-review.googlesource.com/505476 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* futility: Fix issues with validation of recovery MRC cacheFurquan Shaikh2017-06-151-12/+40
| | | | | | | | | | | | | | | | | | | | 1. Current assumption in the validation function is that there is only 1 metadata block present in the cache. However, this is not always true (e.g. KBL boards). Thus, update the check to ensure that only 1 metadata block is actually used if multiple such blocks are present. 2. Add a check to ensure that the offset provided is not greater than the file size. BUG=b:62654773 BRANCH=None TEST=Verified that "futility validate_rec_mrc" works fine with the image provided in bug. Also, verified this works fine for poppy. Change-Id: I84b55d1daf884326a2e970e2ac73110c5eeeaa45 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/537074 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* Add a script to generate a keypair for signing Rose RW firmware.Marco Chen2017-06-121-0/+66
| | | | | | | | | | | | | | | Rose decided to leverage the key format of Hammer therefore this script calls Hammer's one to generate a key pair and renames them to key_rose*. BUG=b:37693819 TEST=None BRANCH=None Change-Id: I1f31afe89a00895434a169401ab76b594ad0a403 Reviewed-on: https://chromium-review.googlesource.com/529504 Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org> Tested-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* keygeneration: make helper script executableMike Frysinger2017-06-101-0/+0
| | | | | | | | | | | | BUG=b:35587169 TEST=None BRANCH=None Change-Id: I2098f39dd17893c5e30ed495eaa87935efbcb0ee Reviewed-on: https://chromium-review.googlesource.com/526613 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org>
* Add a script to generate a keypair for signing accessory RW firmware.firmware-twinkie-9628.BMarco Chen2017-06-061-0/+66
| | | | | | | | | | | | | BUG=b:35587169 TEST=None BRANCH=None Change-Id: Ibb309c34ca22d30138cb62d698eafb6ee77add8c Reviewed-on: https://chromium-review.googlesource.com/520368 Commit-Ready: Marco Chen <marcochen@chromium.org> Tested-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* keygeneration: add some output helpersMike Frysinger2017-06-014-13/+35
| | | | | | | | | | | | | | These use the same forms as in other shell projects in CrOS. BUG=b:35587169 TEST=ran create_new_android_keys.sh and new output works BRANCH=None Change-Id: Id75fd77203795d7837537f12ab948376a7ad105e Reviewed-on: https://chromium-review.googlesource.com/520786 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* detachables: Remove locale switch on up arrowShelley Chen2017-05-271-8/+0
| | | | | | | | | | | | | | | This was old code that switched locale when pressing up arrow. BUG=b:35585623 BRANCH=None TEST=Boot to recovery and make sure up arrow doesn't change the locale. Change-Id: Ibb4d2785170a2e36d599e4af56de3dfd922c5957 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/517283 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* detachables: Adding language selection menuShelley Chen2017-05-271-15/+64
| | | | | | | | | | | | | | Handle displaying of language menu. BUG=b:35585623 BRANCH=None TEST=Reboot and select Language from menu, select language and make sure displays menu items in current language. Change-Id: I518021c5278895e95cb4afdde044091c5bec7233 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/477093 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* detachables: Reset timer every time user moves the cursorShelley Chen2017-05-261-0/+6
| | | | | | | | | | | | | | | In dev mode, after 30 seconds of inactivity, we'll get the usual loud beep and automatic boot from disk. BUG=b:35585623 BRANCH=None TEST=reboot and make sure that fw screen timeout only occurs after 30 seconds of inactivity. Change-Id: Id6552f7213a52ed8c0f083a8388719a8fe79fa77 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/457841 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* detachables: Use locale bitmaps instead of textShelley Chen2017-05-261-37/+25
| | | | | | | | | | BUG=b:35585623 BRANCH=None TEST=reboot and make sure that the bitmaps show up Change-Id: I92a9cf7dc808a22c7ace25763d4ef49824a93054 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/457840
* detachables: New code path for displaying detachable menusstabilize-9592.82.Bstabilize-9592.67.Bstabilize-9592.55.Bstabilize-9592.15.Brelease-R60-9592.BShelley Chen2017-05-254-0/+84
| | | | | | | | | | | BUG=b:35585623 BRANCH=None TEST=None CQ-DEPEND=CL:457863 Change-Id: Ib2f8d93334cecfd80169842994ea7561baf41378 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/457839
* rowan: Add preMP keys to vbutil_what_keysPatrick Berny2017-05-251-0/+4
| | | | | | | | | | | | | | | BUG=none BRANCH=ToT TEST=ensure Rowan PreMP keys are correctly output by 'vbutil_what_keys chromeos_9547.0.0_rowan_recovery_canary- channel_premp.bin' Change-Id: I292425106a0b2d8e42f8a31de18edd0e63618842 Reviewed-on: https://chromium-review.googlesource.com/514984 Commit-Ready: Patrick Berny <pberny@chromium.org> Tested-by: Patrick Berny <pberny@chromium.org> Reviewed-by: Patrick Berny <pberny@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* image_signing: ensure_secure_kernelparams.sh: use loopback devices for speedMike Frysinger2017-05-232-4/+64
| | | | | | | | | | | | | | | Rather than read out the whole kernel partition just to dump the kernel config, set the image up via a loopback device and read from there. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: I3797a0e77315e8baf6f481f31c44b889ac6d098a Reviewed-on: https://chromium-review.googlesource.com/505475 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* define callback APIs for auxiliary firmware update.Caveh Jalali2017-05-232-0/+49
| | | | | | | | | | | | | | | TEST="COV=1 make" passes depthcharge still compiles in combination with follow-up CLs, ps8751 firmware update succeeds. BUG=b:35586896 Change-Id: Ibadc41e56e4e25ee0aba5c83caa0e3596fb9ad20 Reviewed-on: https://chromium-review.googlesource.com/505259 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot_ui_menu: Show Developer options on USB failureRizwan Qureshi2017-05-231-0/+2
| | | | | | | | | | | | | | | | | | | | | In the current implementation, if the boot from USB fails after pressing Ctrl-U or selecting "Boot USB Image", only a blank screen is shown instead of a menu. There is no option for the user to do anything else except wait for the timeout, after which boot from fixed disk is attempted. This does not seem like an intuitive boot flow. Hence, if the USB boot fails display the current menu, allowing the user to attempt something else. BUG=None BRANCH=None TEST= verfied that menu is displayed on USB boot failure from developer screen. Change-Id: Ide3967be7bba3d87c8a545a0f4ed52da44150fd0 Signed-off-by: Rizwan Qureshi <rizwan.qureshi@intel.com> Reviewed-on: https://chromium-review.googlesource.com/509671 Commit-Ready: Rizwan Qureshi <rizwan.qureshi@intel.corp-partner.google.com> Tested-by: Rizwan Qureshi <rizwan.qureshi@intel.corp-partner.google.com> Reviewed-by: Shelley Chen <shchen@chromium.org>