summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* vboot_api_kernel: check TPM mode on normal bootfirmware-eve-campfire-9584.131.BJoel Kitching2019-01-081-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When booting into Alt OS legacy mode, we plan to disable TPM before handing off control to the OS. On a warm reboot back to Chrome OS, we must check the TPM mode. If it is disabled, a hard reboot should be triggered to restore TPM functionality. Add this check to VbBootNormal. Only accept the TPM mode VB2_TPM_MODE_ENABLED_TENTATIVE (0). BUG=b:119203340 TEST=compile, flash, and boot eve TEST=run `gsctool -a -m disable` validate that the following messages show up on boot: Calling VbSelectAndLoadKernel(). VbCheckTPM: Checking if TPM needs resetting (TPM_MODE) cr50 TPM 2.0 (i2c 0x50 id 0x28) tpm_internal_mode: Invalid header code: 1286 VbCheckTPM: TPM encountered some error; reset Cr50 tpm_internal_cr50_reset: Asking Cr50 to reset after 500 ms VbCheckTPM: Shut down AP and wait for Cr50 reset VbSelectAndLoadKernel: Returning 65549 Powering off. Exiting depthcharge with code 2 at timestamp: 6603861 Change-Id: If6097aa67eb135e24c735bd7948ec25091bed3be Reviewed-on: https://chromium-review.googlesource.com/c/1354140 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* 2api: add call to reset Cr50Joel Kitching2019-01-083-0/+16
| | | | | | | | | | | | | | | | | When booting into Alt OS legacy mode, we plan to disable TPM before handing off control to the OS. We need to reset Cr50 to get TPM back to its normal state. Add an API call to accomplish this. BUG=b:120586131 TEST=compile, flash, and boot eve Change-Id: I7eec4d97f4c59c63ab5cd0910e6a37f7e2877fc6 Reviewed-on: https://chromium-review.googlesource.com/c/1354146 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot_api_kernel2_tests: correct typo under Alt OS sectionJoel Kitching2018-12-061-1/+1
| | | | | | | | | | | BUG=None TEST=None Change-Id: Idf96610a5ea0bfdbcc03f9f09d19e0bcebf03327 Reviewed-on: https://chromium-review.googlesource.com/c/1358033 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* 2api: add callbacks for tpm_{get,set}_modeJoel Kitching2018-12-063-0/+59
| | | | | | | | | | | | | | | | | | | | | | When booting into Alt OS legacy mode, we plan to disable TPM before handing off control to the OS. On a warm reboot back to Chrome OS, we must check the TPM mode. If it is disabled, a hard reboot should be triggered to restore TPM functionality. Add vboot2 callbacks for tpm_get_mode and tpm_set_mode. vboot_reference code needs to use these TPM vendor-specific commands from depthcharge, but doesn't make sense to re-implement them in the vboot_reference TPM driver (which probably shouldn't exist in the first place). BUG=b:120587305 TEST=compile vboot_reference and depthcharge Change-Id: I8285e518b50e031c6f0cf76f82439ad316ddc6fd Reviewed-on: https://chromium-review.googlesource.com/c/1354139 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* 2return_codes: add external return code for nonexistent TPM commandJoel Kitching2018-12-061-0/+3
| | | | | | | | | | | | | | If the TPM does not support a particular command, vboot functions may return this error. BUG=b:70681930 TEST=None Change-Id: I73da102128422265301b2b5994f3c0a832f7e6fd Reviewed-on: https://chromium-review.googlesource.com/c/1365293 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vb2_api: add vboot_nvstorage.h to internals sectionJoel Kitching2018-12-061-0/+1
| | | | | | | | | | | | | Needed to expose VBNV_RECOVERY_RO_S3_RESUME. BUG=b:70681930 TEST=None Change-Id: I091d78a923f52452d848ffd87f4dd1315b5fec6f Reviewed-on: https://chromium-review.googlesource.com/c/1362268 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* vboot_api_kernel2_tests: fix checking Alt OS flagJoel Kitching2018-12-041-0/+2
| | | | | | | | | | | | | | | VBSD_ALT_OS_LEGACY_BOOT should be checked on both Chrome OS boot and Alt OS boot. BUG=b:70681930,b:118202153,b:118787888 TEST=make clean && ALT_OS=1 COV=1 make coverage; COV=1 make coverage_html Change-Id: I82e0fe74cfde3b968074d863ff6482fc4c7a8c66 Reviewed-on: https://chromium-review.googlesource.com/c/1360012 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Claire Chang <tientzu@chromium.org> Reviewed-by: Youcheng Syu <youcheng@chromium.org>
* rollback_index: add newlines to VB2_DEBUG callsJoel Kitching2018-12-041-2/+2
| | | | | | | | | | | BUG=None TEST=None Change-Id: I47fd7287dfac038f142d0a694e53f20848a75d76 Reviewed-on: https://chromium-review.googlesource.com/c/1354145 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot_api: add VbSaveTpmState call for use in depthchargeJoel Kitching2018-12-043-0/+23
| | | | | | | | | | | | | | | When booting into Alt OS legacy mode, we plan to save TPM state and disable TPM before handing off control to the OS. This API call is needed for saving state in depthcharge just before boot. BUG=b:118172063 TEST=None Change-Id: Ibbee0d6375de2179afa0ba64d272af72185db5a5 Reviewed-on: https://chromium-review.googlesource.com/c/1344329 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot_reference: add flag to record booting through Alt OS legacy modeJoel Kitching2018-12-043-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | When booting into Alt OS legacy mode, we plan to disable TPM before handing off control to the OS. On S3 resume, the TPM is re-enabled, and thus we need to disable it in coreboot's S3 resume path. coreboot needs to know whether or not the system is currently booted into Alt OS legacy mode, so that it only disables TPM in this case. When the decision is made to boot through Alt OS legacy mode, record in a VBSD flag for when this information is needed later on. Additionally, since TPM will be disabled on Alt OS legacy boot, remove the "boot-to-normal" failure path, in case it is triggered after TPM is disabled. Modify Alt OS unit tests accordingly. BUG=b:70681930,b:118202153,b:118787888 TEST=make runtests TEST=make clean && ALT_OS=1 COV=1 make coverage; COV=1 make coverage_html Change-Id: I95005280d507e78b67c30c4cee442ae86c9d0592 Reviewed-on: https://chromium-review.googlesource.com/c/1339599 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot: conditionally build alt os featureTing Shen2018-11-096-3/+44
| | | | | | | | | | | | | | | | | CQ-DEPEND=CL:1322689 BUG=b:118998724 TEST=Run following commands with and without campfire USE flag: emerge-eve vboot_reference cros_run_unit_tests --board eve --packages vboot_reference BRANCH=eve-campfire Change-Id: I4d65ee86919e8fc7a9c8157f9910d68fdc11e671 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/1319532 Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* vboot: create NVRAM flag to pause after EC software syncJoel Kitching2018-10-099-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, it is impossible to programmatically enable/disable Alt OS mode in eve. This is because only EC-RW supports the kbatboot keyboard matrix functionality. But, as part of the campfire boot flow, the keyboard matrix is retrieved *immediately* after jumping into EC-RW. We need to insert a small pause in order to allow for some entity (autotest/servo) to send a kbatboot command, simulating the Alt OS keyboard press hotkey. BUG=b:117140648 TEST=Manually use crossystem to set post_ec_sync_delay=1 Reboot, and wait for the delay to begin Run `kbatboot 1 4 1` in EC console Check that AP console contains: "vb2_post_ec_sync_hooks: post_ec_sync_delay 5000 ms..." TEST=make clean && make runtests Change-Id: I1305357199d87b80b4edc4e311015106ab07de65 Reviewed-on: https://chromium-review.googlesource.com/c/1256644 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Trybot-Ready: Joel Kitching <kitching@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* campfire: sync more flagsTing Shen2018-08-131-2/+6
| | | | | | | | | | | | | BUG=b:112520234 TEST=make runtests BRANCH=eve-campfire Change-Id: I93410ccc5c74841af62e9a3ec85b04691b5043cb Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1172304 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* vboot_reference: sync VBSD flags with ToTTing Shen2018-08-131-2/+6
| | | | | | | | | | | | | | | VBSD_ALT_OS flags conflicts with ToT. Change the conflicted values. BUG=b:112520234 TEST=make runtests BRANCH=eve-campfire Change-Id: I84a5eb22fc0d8e6c46d7a8487a852f2e28c0507f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1172237 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
* vboot: changes to allow RW_LEGACY hash verificationJoel Kitching2018-08-107-13/+41
| | | | | | | | | | | | | | | - Externalize vb2_digest_buffer function to vb2api_digest_buffer. - Add vb2_context as an argument to VbExLegacy function (so that we know whether developer mode is running). BUG=b:110721285 TEST=make runtests Change-Id: I2401842cc044949d8cdfeb21edb7b400a3c32426 Reviewed-on: https://chromium-review.googlesource.com/1133598 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: move Alt OS hotkey stub from switches to keyboardJoel Kitching2018-07-312-3/+3
| | | | | | | | | | | | | | | | | vb2ex_get_alt_os_hotkey ended up in keyboard.c instead of switches.c. vboot stubs should reflect this location appropriately. BUG=b:70804764 TEST=make runtests TEST=emerge-eve coreboot Change-Id: I8c75f089cb56f90f4c326ab38abfe16ff751c35d Reviewed-on: https://chromium-review.googlesource.com/1156199 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Trybot-Ready: Joel Kitching <kitching@chromium.org>
* depthcharge: fix Alt OS VbTryLegacy callJoel Kitching2018-07-301-1/+1
| | | | | | | | | | | | | | | | Remove extra parameter added for RW_LEGACY verification in a later CL. BUG=b:70804764 TEST=make runtests BRANCH=firmware-eve-campfire Change-Id: I5a10bcad55e61b10dde0504a55b56df3d628db38 Reviewed-on: https://chromium-review.googlesource.com/1154729 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Trybot-Ready: Joel Kitching <kitching@chromium.org>
* depthcharge: initial implementation of Alt OS boot flowJoel Kitching2018-07-2710-2/+402
| | | | | | | | | | | | | | | | | | | | The goal of Alt OS is to allow for booting of alternate operating systems without leaving verified normal mode. See here for details: go/vboot-altos BUG=b:70804764 TEST=make runtests TEST=COV=1 make coverage TEST=Step with GDB and either use kbatboot or hold down A CQ-DEPEND=CL:1126806,CL:972763 BRANCH=firmware-eve-campfire Change-Id: I71045f6a0f29768f15fcb4130f6063d4190611bb Reviewed-on: https://chromium-review.googlesource.com/983312 Tested-by: Joel Kitching <kitching@chromium.org> Trybot-Ready: Joel Kitching <kitching@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
* vboot: define constant for Alt OS picker screenJoel Kitching2018-07-201-0/+2
| | | | | | | | | | | | | | BUG=b:70804764 TEST=None BRANCH=firmware-eve-campfire CQ-DEPEND=CL:972763 Change-Id: I02cb0ad80d0e9545e654cfb745fe22524d70b12d Reviewed-on: https://chromium-review.googlesource.com/1144585 Tested-by: Joel Kitching <kitching@chromium.org> Trybot-Ready: Joel Kitching <kitching@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* depthcharge: add Alt OS TPM flags and utility functionsTing Shen2018-07-203-1/+58
| | | | | | | | | | | | | | BUG=b:70804764 TEST=None BRANCH=firmware-eve-campfire-9584.131.B Change-Id: I42621854968dc26f86110f3de82a293a88934638 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1034484 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Trybot-Ready: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* Add AltOS NVRAM flagsTing Shen2018-05-048-1/+65
| | | | | | | | | | | | | | | | This CL adds (enable|disable)_alt_os_request flag for AltOS boot flow. BRANCH=eve-campfire BUG=b:70804764 TEST=1. make runtests 2. Manually set and get new flags via crossystem Change-Id: Ib352da6fe4767f3f343dd1ea6ed9521142c9b9e0 Reviewed-on: https://chromium-review.googlesource.com/1009444 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Trybot-Ready: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* ec_sync: Commit NVRAM updates before battery cutoffBrian Norris2018-02-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Battery cutoff may cause the entire system to lose power, which means that any uncommitted nvram updates will be lost. This can leave us in a battery cutoff loop, where we never completely clear the BATTERY_CUTOFF_REQUEST flag before actually cutting off power. The only way to escape this potential cutoff loop is if we manage to cleanly exit to vb2_kernel_cleanup(), where we perform a similar commit. But this requires us to retain power for some time after VbExEcBatteryCutOff(). BRANCH=none BUG=b:70176744 TEST=`crossystem battery_cutoff_request=1` on scarlet, then reboot; see battery cutoff; plug in AC and observe whether we reliably boot on first attach Change-Id: Icdb8eed92c74fe4ae10fec8e93d9e5754f10c730 Signed-off-by: Duncan Laurie <dlaurie@google.com> Original-Commit-Id: b00bf851cdaada874b7c66c6913d0cef0798fcbf Original-Change-Id: I1acf3aaeaf76f97f7603f79dbfef7a24a96f36dc Original-Signed-off-by: Brian Norris <briannorris@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/876783 Original-Reviewed-by: Philip Chen <philipchen@chromium.org> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/914550
* ec_sync: always call VbExUpdateAuxFwCaveh Jalali2018-02-122-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: I341035188e622772d64b98414bdf81d9444b9a89 Signed-off-by: Duncan Laurie <dlaurie@google.com> Original-Commit-Id: 5afa7faf7bfc4ec5efd22af5f2124a575bc64e52 Original-Change-Id: I9244db28ed181f568d117092307293202257735b Original-Signed-off-by: Caveh Jalali <caveh@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/620281 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/914549
* call depthcharge hooks for auxiliary FW update.Caveh Jalali2018-02-124-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: I307b07d0726937e4e54c9ae5848a1ef252128db7 Signed-off-by: Duncan Laurie <dlaurie@google.com> Original-Commit-Id: 3dd580298b42d9d77e1f37733e4df2b6d5c302c6 Original-Change-Id: If0d634eab08b429a8e7e80f5fe11eab3705bba0f Original-Signed-off-by: Caveh Jalali <caveh@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/505260 Original-Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/914548
* keygeneration: add some output helpersMike Frysinger2017-06-054-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: Ib1f3c2c598c54f6cfcb1a6484ce396a1ad55cd0f Signed-off-by: Duncan Laurie <dlaurie@google.com> Original-Commit-Id: fda130046407a8e83f9eec8ed66f80426692dc2d Original-Change-Id: Id75fd77203795d7837537f12ab948376a7ad105e Original-Reviewed-on: https://chromium-review.googlesource.com/520786 Original-Commit-Ready: Mike Frysinger <vapier@chromium.org> Original-Tested-by: Mike Frysinger <vapier@chromium.org> Original-Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/524230
* detachables: Remove locale switch on up arrowShelley Chen2017-06-051-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: Ie270ad56aa22719389e9db748ff0168dd56d84e5 Signed-off-by: Duncan Laurie <dlaurie@google.com> Original-Commit-Id: de4cefc915938a787575786c3526599f61de1a63 Original-Change-Id: Ibb4d2785170a2e36d599e4af56de3dfd922c5957 Original-Signed-off-by: Shelley Chen <shchen@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/517283 Original-Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/524229
* detachables: Adding language selection menuShelley Chen2017-06-051-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: I17c40697c7ed07becd69fde332a696d53adea909 Signed-off-by: Duncan Laurie <dlaurie@google.com> Original-Commit-Id: 46802fddebda46addece9fda836590caf3b97794 Original-Change-Id: I518021c5278895e95cb4afdde044091c5bec7233 Original-Signed-off-by: Shelley Chen <shchen@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/477093 Original-Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/524228
* detachables: Reset timer every time user moves the cursorShelley Chen2017-06-051-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: Id7104ba6aa7ddda85a386ae71e5797af65e78ebf Signed-off-by: Duncan Laurie <dlaurie@google.com> Original-Commit-Id: 87666b349e039b94eb3d0a77c1262424beff2bf4 Original-Change-Id: Id6552f7213a52ed8c0f083a8388719a8fe79fa77 Original-Signed-off-by: Shelley Chen <shchen@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/457841 Original-Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/524227
* detachables: Use locale bitmaps instead of textShelley Chen2017-06-051-37/+25
| | | | | | | | | | | | | | BUG=b:35585623 BRANCH=None TEST=reboot and make sure that the bitmaps show up Change-Id: I6a642d8f7571335ff4a1ee902e136776e2ea8924 Signed-off-by: Duncan Laurie <dlaurie@google.com> Original-Commit-Id: 2b8ea31e67df90c708a63291748bc96b452f0e8b Original-Change-Id: I92a9cf7dc808a22c7ace25763d4ef49824a93054 Original-Signed-off-by: Shelley Chen <shchen@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/457840 Reviewed-on: https://chromium-review.googlesource.com/524226
* detachables: New code path for displaying detachable menusShelley Chen2017-06-054-0/+84
| | | | | | | | | | | | | | | BUG=b:35585623 BRANCH=None TEST=None CQ-DEPEND=CL:457863 Change-Id: Ia0e5ec702c70fe6af9b5f42fef6255de857619a5 Signed-off-by: Duncan Laurie <dlaurie@google.com> Original-Commit-Id: 2ed9ca605c7ad48b4a2821c5d90c0b569a0afbfe Original-Change-Id: Ib2f8d93334cecfd80169842994ea7561baf41378 Original-Signed-off-by: Shelley Chen <shchen@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/457839 Reviewed-on: https://chromium-review.googlesource.com/524225
* rowan: Add preMP keys to vbutil_what_keysPatrick Berny2017-06-051-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: I68e880867d012058fddca41f68e821492b7067c3 Signed-off-by: Duncan Laurie <dlaurie@google.com> Original-Commit-Id: 05f6675acd42006421d73f44f67b679e2c57909a Original-Change-Id: I292425106a0b2d8e42f8a31de18edd0e63618842 Original-Reviewed-on: https://chromium-review.googlesource.com/514984 Original-Commit-Ready: Patrick Berny <pberny@chromium.org> Original-Tested-by: Patrick Berny <pberny@chromium.org> Original-Reviewed-by: Patrick Berny <pberny@chromium.org> Original-Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/524224
* 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>
* image_signing: unify output helpersMike Frysinger2017-05-196-41/+47
| | | | | | | | | | | | | | | | | | | | We have `err_die` and `die` helpers that do the same thing, but some scripts just have to know which one to use based on their runtime. Just unify them as the more common `die` so all scripts can use it. Similarly, we provide info, warn, and error to dev scripts, but not to the runtime ones. Add small stubs in common_minimal.sh so the API is consistent. BRANCH=None BUG=chromium:718184 TEST=scripts still work Change-Id: Id44fb27900c37f4e357d20817f909e4534d1c5b3 Reviewed-on: https://chromium-review.googlesource.com/507990 Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org>
* image_signing: fix key insert logicMike Frysinger2017-05-161-2/+1
| | | | | | | | | | | | | | | | We don't want to override the common trap as the common sh files already have handlers installed to clean up files/mounts. Re-use those helpers to avoid leaking loopback mounts. BRANCH=None BUG=chromium:718184 TEST=signing images still works Change-Id: I749ce5075194356219fea51152154fdc5a2e3b99 Reviewed-on: https://chromium-review.googlesource.com/505575 Reviewed-by: Eric Caruso <ejcaruso@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org>
* image_signing: strip_boot_from_image.sh: convert to info/error helpersstabilize-9554.BMike Frysinger2017-05-131-2/+2
| | | | | | | | | | | | | | This makes the output easier to follow when multiple scripts are being run. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: I48edde260e1d1db88f65624c7ff46ad2ac1cc2f4 Reviewed-on: https://chromium-review.googlesource.com/498100 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* image_signing: resign_image.sh: drop unused scriptMike Frysinger2017-05-131-56/+0
| | | | | | | | | | | | | | | This script hasn't been executed by image_signing or the cros-signer code, and cs/ doesn't turn up any hits. Scrub it from the codebase. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: Ief4256a8ceab753d5c1fd6d0f3d81609e11f62a9 Reviewed-on: https://chromium-review.googlesource.com/500329 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: convert to info/error helpersMike Frysinger2017-05-131-45/+39
| | | | | | | | | | | | | | This makes the output easier to follow when multiple scripts are being run. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: I4097fd58f349dc84c242dd12d6a94e12f387a1f0 Reviewed-on: https://chromium-review.googlesource.com/498232 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* image_signing: ensure_sane_lsb-release.sh: convert to info/error helpersMike Frysinger2017-05-131-9/+9
| | | | | | | | | | | | | | This makes the output easier to follow when multiple scripts are being run. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: I7351e1ff63bb7e88e4449dd2718685fef7ec031d Reviewed-on: https://chromium-review.googlesource.com/498267 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* image_signing: ensure_no_nonrelease_files.sh: convert to info/error helpersMike Frysinger2017-05-121-3/+3
| | | | | | | | | | | | | | This makes the output easier to follow when multiple scripts are being run. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: I666d3f5beee4b4e3e9903d546ef66917990a659e Reviewed-on: https://chromium-review.googlesource.com/498231 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* image_signing: make_dev_ssd.sh: convert to info/error helpersMike Frysinger2017-05-121-18/+18
| | | | | | | | | | | | | | This makes the output easier to follow when multiple scripts are being run. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: I96e20f38b6a51ad4dc8064fa3fb3d4302c47888f Reviewed-on: https://chromium-review.googlesource.com/497302 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* image_signing: common.sh: prefix helper messages with $PROG by defaultMike Frysinger2017-05-111-3/+4
| | | | | | | | | | | | | | This makes the output easier to follow when multiple scripts are being run. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: I072994dd07cf559a60e8a139eaeaf000cbbf72e3 Reviewed-on: https://chromium-review.googlesource.com/497301 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* image_signing: do not fail when chronos does not existMike Frysinger2017-05-111-1/+4
| | | | | | | | | | | | | | | If the device doesn't create a chronos user, don't throw errors. For some embedded systems, they don't need a chronos user. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: I4604beae1e647e024a04583471b8a7d0d4f188fa Reviewed-on: https://chromium-review.googlesource.com/500027 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* image_signing: swap_rootfs.sh: drop unused scriptMike Frysinger2017-05-101-29/+0
| | | | | | | | | | | | | | | This script hasn't been executed by image_signing or the cros-signer code, and cs/ doesn't turn up any hits. Scrub it from the codebase. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: Ic9cf90929f949a7f6b4e41e5b819d6f786c1c833 Reviewed-on: https://chromium-review.googlesource.com/500328 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org>
* image_signing: output pubkey in DER formatMike Frysinger2017-05-101-1/+6
| | | | | | | | | | | | BRANCH=None BUG=chromium:718184 TEST=new imageloader works Change-Id: I430ed616954c820d3d1607eefd4f8e1c60863a8f Reviewed-on: https://chromium-review.googlesource.com/497914 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Greg Kerr <kerrnel@chromium.org>
* vboot: Add multiboot kernel typeDuncan Laurie2017-05-082-4/+7
| | | | | | | | | | | | | | Add a kernel type for signing multiboot kernel images. BUG=b:38040849 BRANCH=none TEST=properly sign a multiboot kernel image and then verify the resulting image. Change-Id: If00e7c85244bc59853c305e42543f34c5fabf356 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/497933 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: Verify linux kernel signatureDuncan Laurie2017-05-082-1/+16
| | | | | | | | | | | | | | | | | Verify the linux kernel signature on images before assuming they contain a linux kernel. This allows non-linux images on x86 to be left unmodified when signed. BUG=b:38040849 BRANCH=none TEST=sign a multiboot kernel image that remains unmodified, and ensure that x86 linux kernels are still updated properly and can still be booted. Change-Id: Ib7ba2d59ebe6413ab355aa7c0a9ee2e32c3ed98a Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/497932 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* image_signing: set_channel: use new lsbval helperMike Frysinger2017-05-071-1/+1
| | | | | | | | | | | | | | Minor clean up to the logic. BUG=None TEST=`./set_channel recovery_image.bin stable-channel` changed the lsb-release file to stable BRANCH=None Change-Id: Idf12b643f88e373b528b50e269537b861052b448 Reviewed-on: https://chromium-review.googlesource.com/414225 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* image_signing: fix signing of zip/crx filesMike Frysinger2017-05-041-10/+10
| | | | | | | | | | | | | | Restore the search logic for manifests in subdirs. BRANCH=None BUG=chromium:697645 TEST=signed adb/fastboot zip archives Change-Id: I07a417216ea463cb00d6ead7cd3b61d6e6fa507d Reviewed-on: https://chromium-review.googlesource.com/494207 Commit-Ready: Hsinyu Chao <hychao@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Eric Caruso <ejcaruso@chromium.org>