summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Initialize retfirmware-grunt-11031.Bfirmware-grunt-11031.149.BMathew King2019-06-181-0/+1
| | | | | | | | | | | | | | | | | | Without this debug builds will fail. BUG=none TEST=USE=debug emerge-sarien depthcharge libpayload chromeos-bootimage BRANCH=none Change-Id: Iff182a116e89a8144a2102b288ea87fa75ff8885 Signed-off-by: Mathew King <mathewk@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1553920 Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> (cherry picked from commit b720a103b75ac1516736e57930407e2e0e9bb669) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1665010 Commit-Queue: Raul E Rangel <rrangel@chromium.org> Tested-by: Raul E Rangel <rrangel@chromium.org>
* lib/vboot_kernel: Log speed at which kernel was loadedRaul E Rangel2019-06-181-1/+9
| | | | | | | | | | | | | | | | | | | | | This makes it easy to spot the speed at which the eMMC controller is running. vb2_load_partition: read 8419 KB in 48 ms at 174342 KB/s. The calculation looks a little funky because I wanted to perform all multiplications before the division to avoid losing any precision. BRANCH=grunt BUG=b:122244718 TEST=Verified it on grunt Change-Id: I5fac584994bc478bfb27cbd4e2ea34af0be7f1d9 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1661366 Reviewed-by: Julius Werner <jwerner@chromium.org> (cherry picked from commit 4c1a6f4872f405619f0dc4f2db477edf540fdd24) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1664759
* vboot_api: Add new VB_AUX_FW_NO_DEVICE update severityKarthikeyan Ramasubramanian2018-11-271-3/+5
| | | | | | | | | | | | | | | | | | | | | | There is a possibility that a registered device is not present at run-time and this scenario needs to be handled a little different. Add a new update severity to handle this situation. BUG=chromium:896451 BRANCH=None TEST=bootup to ChromeOS by connecting and disconnecting the USB daughterboard Change-Id: I8a2044ce6a10fe611ee1f47262a7b54598a53ce3 Signed-off-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1299993 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1352629 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Add a screen showing a menu for alternative firmwareSimon Glass2018-11-2710-63/+320
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present we allow the user to press a keypad number to boot into another bootloader but there is no indication which one is which. Add a new screen for this. It is entered via Ctrl-L and shows the available bootloaders, along with the number to press for each. The contents of the screen is rendered by the bootloader, as usual. This is supported by two new screens, one for the keyboard UI and one for the menu UI. Also a new function, VbExGetAltFwIdxMask(), is added to find out what bootloaders are available. Note: This CL combines changes for both UIs. The changes may be easier to review separately. CQ-DEPEND=CL:1273269 BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: Ib3227545dc677c8f9587944753e32f3b49647360 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1273268 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1351848 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Pass all calls to VBExLegacy() through a single functionSimon Glass2018-11-145-60/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is important that we lock the TPM before calling this function. We have several places where the function is called. Reduce the risk that the TPM is no locked by running all calls through a single point. Drop the vb2_exit_altfw() function as it is not needed now. We rely on being able to call RollbackKernelLock() multiple times since it ignores subsequent calls and does not attempt to lock the TPM twice. With the menu UI this causes a small change in behaviour: when starting legacy firmware fails the screen flashes AFTER the beep instead of before. Hopefully this difference is not important. Future work will unify the two UI more. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I0ee0b52eb57c30c1e1bb4a7e60e11d060025ab17 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1292248 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1335660 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Create a new file for common vboot UI functionsSimon Glass2018-11-146-26/+51
| | | | | | | | | | | | | | | | | | | | Rather than having vboot_ui be the common file between that and vboot_ui_menu, create a new file. For now just move over vb2_error_beep(). The other common functions are being removed in future CLs. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: Iff6917642ff79ea0b5cce60b383876b6f7174d20 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1310794 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1335659 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Unify the rest of the beepsSimon Glass2018-11-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | In some cases we use a a single high beep to signal an error. It does not seem important to distinguish this from any other kind of error, so just use the existing case. All beeping now goes through vb2_error_beep(), except for one beep in vboot_audio.c. We could move vb2_error_beep() to vboot_audio.c, but the beeps seem to be a part of the UI rather than the audio system. Of course, vb2_audio_looping() arguable is also... BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I55807b4548987a621e8bbced97e7710d6cd6d5fb Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1292247 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1335658 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Add a parameter to vb2_error_beep()Simon Glass2018-10-303-20/+32
| | | | | | | | | | | | | | | | | | | | | | | | We have two different types of beep each with its own meaning: - two high beeps: not allowed - single low beep: allowed but it failed Add an enum to cover this and update all callers. In VbTryUsb() there is a delay after the beep but that does not seem to be needed, so drop it. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I824d088d1a51aeb5a35b5978a05533e8eabcf8f6 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1292246 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Julius Werner <jwerner@chromium.org> (cherry picked from commit e156d3a3ec014d148009a1fe4e2fe97d5560d66e) Reviewed-on: https://chromium-review.googlesource.com/c/1308605 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Add a constant for the escape keySimon Glass2018-10-253-5/+6
| | | | | | | | | | | | | | | | | We use this in a few places, so add a constant. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I7182d0ac52c23c01397de08683ad83b818486f91 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1286221 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 4d4c36e9df592548ae169cf6f145ecc9399a7963) Reviewed-on: https://chromium-review.googlesource.com/c/1299607 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Export vb2_error_beep()Simon Glass2018-10-233-14/+15
| | | | | | | | | | | | | | | | | This code is used in both the keyboard and detachable UIs. Make it into a common function and export it. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I1e2cf67ec3fce9bc78ad412ddcc34e0eaecab5eb Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1286220 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1297022 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Split out functions which handle alternative firmwareSimon Glass2018-10-232-17/+58
| | | | | | | | | | | | | | | | | | | | | | At present we have all the logic for this feature in VbTryLegacy(). In preparation for adding a new menu for alternative firmware, split the logic into two pieces: preparing to start alternative firware, and cleaning up afterwards if nothing booted. Also export these functions so that they can be used by the detachable UI. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I560634ebb03a7f02a488defa32b83e51001d018e Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1286219 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1297021 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Add a variable for allowing alternative firmwareSimon Glass2018-10-231-3/+5
| | | | | | | | | | | | | | | | | | | | At present the condition for this is checked in one place in boot_legacy_action(). We need to be able to check it in more than one place, so put it in a variable when entering developer mode. This matches how the keyboard UI works. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: Iaf01b827095b0a1139a36af6834eba4dbf7fb150 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1286218 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1297020 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Move developer menu code higher in the fileSimon Glass2018-10-231-93/+94
| | | | | | | | | | | | | | | | | | We want to reuse this code for the altfw feature. Move it up in the file to permit this without needing forward declarations. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I02e6cdfb1ea7d5b48e272a778976cdaf50378235 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1286217 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1297019 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* firmware/lib/vboot_ui: Add a VbExSleepMs to the developer mode UIsRaul E Rangel2018-10-232-0/+9
| | | | | | | | | | | | | | | | | | This won't have any real power savings until the APIC delay is merged and enabled. BUG=b:109749762 BRANCH=none TEST=Booted grunt and made sure the developer screens still worked. Change-Id: I7d75198771946415fa6a8fa69dff024d87ba5ef0 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1182190 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1297018 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* add extern C markers to installed headersMike Frysinger2018-10-2315-0/+121
| | | | | | | | | | | | | | | | | | Some of the headers have extern C markings already, so add to the rest of the installed files so users don't have to. BUG=chromium:878440 TEST=build passes BRANCH=none Change-Id: I3edf56ca2235269803049207806a9f7eb4c664f2 Reviewed-on: https://chromium-review.googlesource.com/1201042 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1297017 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Add support for booting into alternative boot loadersSimon Glass2018-10-116-9/+87
| | | | | | | | | | | | | | | | | | | | | | | Add a generic way of selecting an alternative bootloader to run from the developer-mode menu. This enables keys 1-9 to select a particular numbered bootloader. Adjust VbExLegacy() to take a numeric parameter to signal which boot loader to run. CQ-DEPEND=CL:1228875 BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I02eab1b87e21a6401ec42317c4c1fa1bd2767b53 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1060854 Reviewed-by: Julius Werner <jwerner@chromium.org> (cherry picked from commit 89a517730f0207dbef9b3ff219d360904dca456e) Reviewed-on: https://chromium-review.googlesource.com/c/1277325 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Ignore power button if held on startupEdward Hill2018-10-052-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ignore a power button push until after we have seen it released, to avoid shutting down immediately if the power button is held down on startup. BUG=b:116819414,chromium:670492 BRANCH=grunt TEST=manual: 1) Press and hold esc+refresh+power. 2) Depthcharge shows INSERT screen and does not power off. 3) Release esc+refresh+power. 4) Press and release power. 5) Depthcharge powers off. TEST=test_that --fast -b grunt $grunt_ip firmware_ECLidShutdown TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I7421a4b1a1b8a7894f0e7d1c7927ffc52d9faac0 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1256023 Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> (cherry picked from commit 00d4be66721b24903f977e770148179035254e19) Reviewed-on: https://chromium-review.googlesource.com/c/1263029 Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* futility: cmd_update: Preserve image sections before updateHung-Te Lin2018-09-012-0/+115
| | | | | | | | | | | | | | | | | When updating RO (or going to compare with contents), we need to preserve (copy) section data from system active firmware image. The `preserve_images` will try to preserve a list of known sections in full update (`--wp=0`) mode, so we VPD data and HWID won't be lost. BUG=chromium:875551 TEST=make futil; tests/futility/run_test_scripts.sh BRANCH=None Change-Id: I85c4ba972853dbc0fc101bee269c0effe70988b1 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1183653 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: cmd_update: Implement updater logic "TRY-RW" (--try)Hung-Te Lin2018-08-312-3/+129
| | | | | | | | | | | | | | | | | | | | In vboot2, to try one RW (unused) section on next boot, we have to: - Find mainfw_act - Select and update to the "other" slot - Set system property fw_try_{next,count} values to try in next boot. The new '--try' (-t) option can trigger the mode if available. BUG=chromium:875551 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility futility update --emulation FILE -i IMAGE -t --sys_prop 0; # Updates to B. futility update --emulation FILE -i IMAGE -t --sys_prop 1; # Updates to A. BRANCH=None Change-Id: I4b4662616a7181d2f37307238b7b80ae82369768 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1188017 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: cmd_update: Add 'mainfw_act' system propertyHung-Te Lin2018-08-312-2/+36
| | | | | | | | | | | | | | | | | | | Add the system property 'mainfw_act'. In both vboot1 and vboot2, the try-rw update process will need to figure out what is current (active) firmware slot, which is the "mainfw_act" system property. BUG=chromium:875551 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility futility --debug update -i IMAGE --sys_prop 0; futility --debug update -i IMAGE --sys_prop 1; BRANCH=None Change-Id: Ie745726107bff416549ba095a3defdd4cc98d32d Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1183652 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: cmd_update: Implement updater logic "RW UPDATE".Hung-Te Lin2018-08-312-6/+109
| | | | | | | | | | | | | | | | | | The logic is same as --mode=recovery,--wp=1 in legacy firmware updater. An debugging option '--wp' is introduced so user can easily switch between FULL UPDATE (--wp=0) or RW UPDATE (--wp=1). BUG=chromium:875551 TEST=make futil; futility update -i IMAGE --wp=0; futility update -i IMAGE --wp=1; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: Ic7d8aa8b327296988ebf80a8e737e8893b7870ea Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1188016 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: cmd_update: Add "system property" and '--sys_props' to overrideHung-Te Lin2018-08-312-0/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When updating firmware, we may need to get some system environment status, like which firmware slot was selected and boot (active), or setting cookies so the next boot will be using right (updated) slot. In verified boot, these status are manipulated by "system property" using API Vb{Get,Set}SystemProperty{String,Int}. The user land tool is `crossystem`. In order to run the firmware updater for testing and debugging, we need an easy way to toggle getting real system status, or fetch from predefined values. A new 'system_property' structure is introduced and included as part of `updater_config`. Each property can be access by `get_system_property(property_type)` function. If the value was not fetched yet, the function will call corresponding 'getter' function defined in property and then cache it. A new parameter '--sys_props` is also introduced so we can easily override them from command line so the updater will not get status from running system. The --sys_props takes a list of integers, eliminated by space or comma. For example, "1,2,3" => overrides [0]=1, [1]=2, [2]=3. "1 2,3" => overrides [0]=1, [1]=2, [2]=3. "1, ,3" => overrides [0]=1, [2]=3. BUG=chromium:875551 TEST=make futil; futility update -i IMAGE tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: Ia2e06a953da1480da9a94f7f397802caa7468efa Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1188015
* futility: cmd_update: Implement updater logic "FULL UPDATE".stabilize-atlas-11022.BHung-Te Lin2018-08-312-14/+179
| | | | | | | | | | | | | | | The logic is same as --mode=factory or --mode=recovery,--wp=0 in legacy firmware updater. BUG=chromium:875551 TEST=make futil; futility update -i IMAGE tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: Ifbfc4fb76f954483e779c8b508377d07561b67da Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1183651 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: cmd_update: Add '--emulate' optionHung-Te Lin2018-08-312-7/+62
| | | | | | | | | | | | | | | | | | To help debugging and testing, we may want to run updater against an image file instead of modifying real system firmware. The --emulate allows running with all checks and reading, and outputs to given file. BUG=chromium:875551 TEST=make futil; futility update -i IMAGE --emulate IMAGE2 tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: Ic52fe60a1468f29245cade70f859513d8d117c9c Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1184953 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: cmd_update: Access system firmware using external flashromHung-Te Lin2018-08-312-4/+100
| | | | | | | | | | | | | | | | | | | | | To manipulate the firmware contents on device, we need to access the flash chipset (usually via SPI) on system. The `host_flashrom` provides a way to call external program "flashrom" for reading and writing firmware. So the `update_firmware` can now load "system current firmware" using flashrom. Note in the future we may want to statically link the flashrom as library so there won't be external dependency. BUG=chromium:875551 TEST=make futil; futility update -i IMAGE tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I52f2d4fe4fe4dd660f762a5a75e3367820717e19 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1183650 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: cmd_update: Process FMAP and parse image versionHung-Te Lin2018-08-312-1/+105
| | | | | | | | | | | | | | | | | Add `find_firmware_section` and `firmware_section_exists` utility functions to manipulate FMAP based sections easily. It is used by parsing of image version strings, which helps indicating the firmware versions going to be updated. BUG=chromium:875551 TEST=make futil; futility update -i /build/eve/firmware/image.bin tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I458fa8c31c45dbbd29614c3d6ccd586e46a3ed0b Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1183649 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: cmd_update: Support loading image files by -i, -e, --pd_imageHung-Te Lin2018-08-312-2/+92
| | | | | | | | | | | | | | | | | | | To specify images, we want to read them from files specified from command line: -i: AP (host) firmware image. -e: EC firmware image. --pd_image: PD firmware image (deprecated). BUG=chromium:875551 TEST=make futil; futility update -i /build/eve/firmware/image.bin tests/futility/run_test_script.sh $(pwd)/build/futility BRANCH=None Change-Id: I3c2dbe3d3ce4619aa7e044a154be3aba7ab9181c Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1183648 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: Add 'update' command for updating firmwareHung-Te Lin2018-08-314-0/+119
| | | | | | | | | | | | | | | | A reference firmware updater for all systems running vboot using FMAP for layout. The updater is currently a dummy implementation and will be completed with incoming changes. BUG=chromium:875551 TEST=make futil; build/futility/futility update; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I57bec91c178749b79a19789f9599f5f9048fced8 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1182701 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: Add 'Error' utility macroHung-Te Lin2018-08-311-0/+3
| | | | | | | | | | | | | An 'Error' is easier than writing fprintf(stderr, "ERROR: %s", ...). BUG=chromium:875551 TEST=make futil; BRANCH=None Change-Id: Id4a849014dc202319dc1932289c68f43b2430c7d Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1183647 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cgpt: add edit commandstabilize-nocturne-10986.Bstabilize-11021.84.Bstabilize-11020.Bstabilize-11005.Bstabilize-10985.Brelease-R70-11021.Bfirmware-servo-11011.Bfirmware-nocturne-10984.Bfactory-nocturne-10984.BMatt Delco2018-08-158-0/+161
| | | | | | | | | | | | | | | | This change adds a command to cgpt to change the GUID of the drive. BRANCH=none BUG=None TEST=Compiled and ran utility to verify that GUID changes. Also verified that the new and existing tests completed successfully. Change-Id: Ia8a815447509626312e2b06c6f293901290c73c3 Signed-off-by: Matt Delco <delco@google.com> Reviewed-on: https://chromium-review.googlesource.com/1171834 Reviewed-by: Julius Werner <jwerner@chromium.org>
* cgpt: show verbose details when primary ignoredMatt Delco2018-08-141-4/+5
| | | | | | | | | | | | | | | | | | A later change I authored has the tests check the GUID of the drive. When the primary table is ignored the GUID from the secondary wasn't being displayed either. This change has the details of the secondary table get displayed when the primary table is ignored. BRANCH=none BUG=None TEST=Compiled. The change was runtime tested as part of a larger change though I didn't unit test this particular change after it was split out into a separate commit. Change-Id: I300511cf65c67f4888e08ab49cd72c7acf234507 Signed-off-by: Matt Delco <delco@google.com> Reviewed-on: https://chromium-review.googlesource.com/1173410 Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot_reference: sync flags with eve-campfire branchTing Shen2018-08-143-1/+11
| | | | | | | | | | | | | BUG=b:112520234 TEST=make runtests BRANCH=master Change-Id: I84ea07f948fec9aa2945c10831f434e77b0e435d Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1172305 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* vboot: remove line length check from lsb_syntaxcheck()Bob Moragues2018-08-131-8/+0
| | | | | | | | | | | | | | | | | | Unibuilds, such as Octopus, generate long lines listing the individual board names. Removing a check which is restricting the unibuilds ability to add additional boards to the list. BUG=chromium:873552 BRANCH=none TEST=none Change-Id: I080f4f251935eb19ee3377556500a5bd98117a2f Reviewed-on: https://chromium-review.googlesource.com/1173256 Commit-Ready: Bob Moragues <moragues@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot_reference: Change OOBE autoconfig TPM space to storing 32-byte hashTudor Brindus2018-08-081-4/+4
| | | | | | | | | | | | | | | | | This commit switches from claiming 33 bytes of NVRAM for the compressed representation of a prime256v1 compressed public key to 32 bytes for its SHA256 hash. This makes it easier to process with the standard OpenSSL binary. BUG=chromium:845589 TEST=make runtests BRANCH=none Change-Id: Ic641b800bcbf2158d52ffbebbf143c47061e8cc3 Reviewed-on: https://chromium-review.googlesource.com/1161496 Commit-Ready: Tudor Brindus <tbrindus@chromium.org> Tested-by: Tudor Brindus <tbrindus@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add AltOS NVRAM flagsTing Shen2018-08-076-1/+31
| | | | | | | | | | | | | | | | Port CL:1009444 to ToT. Adds (enable|disable)_alt_os_request flag for AltOS boot flow. BRANCH=none BUG=b:70804764 TEST=1. make runtests 2. Manually, set and get new flags via crossystem Change-Id: Ie7fe2620f736335f11c39cbfe37b3fdf400ff926 Reviewed-on: https://chromium-review.googlesource.com/1014840 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot: bulk fix tabs and spacing inconsistencyJoel Kitching2018-08-0373-1054/+1081
| | | | | | | | | | | | | | | | | | | Problem files were found with: find . -name '*.c' -o -name '*.h' | xargs grep '^ [^*]' and edited manually. Ignores utility/ and cgpt/, since they seem to globally adhere to a two-space tab convention. BUG=None TEST=make clean runtests TEST=emerge vboot_reference depthcharge Change-Id: I5a678484a119c8f1911f717e1968bdb4f1a0810f Reviewed-on: https://chromium-review.googlesource.com/1160131 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot_reference: Add recoverysw_is_virtual flag to crossystemTudor Brindus2018-08-022-0/+8
| | | | | | | | | | | | | | | | | | This commit adds a flag recoverysw_is_virtual for determining whether a device's recovery switch status (as given by recoverysw_cur) is from a physical button or a line connected to Servo, without a physical button (e.g. veyron_minnie). BRANCH=none BUG=chromium:845589 TEST=manually tested on cave and veyron_minnie; make runtests Change-Id: If8e54e1df78b25a52dbf359ce641bea75533d705 Reviewed-on: https://chromium-review.googlesource.com/1157537 Commit-Ready: Tudor Brindus <tbrindus@chromium.org> Tested-by: Tudor Brindus <tbrindus@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: Add .clang-format fileRaul E Rangel2018-08-021-0/+10
| | | | | | | | | | | | | Copied from depthcharge. BUG=none BRANCH=none TEST=formatted some code Change-Id: I9b9916df7da6195c753f2ce9ddbf37baf8a3e747 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1160930 Reviewed-by: Martin Roth <martinroth@chromium.org>
* vbutil_what_keys: support 16 MB firmware imagesJoel Kitching2018-07-311-1/+1
| | | | | | | | | | | | | | | | Previously, vbutil_what_keys assumed any input files of size 8 MB or lower are firmware images. Push that size up to 16 MB to support larger firmware images, such as that of eve's. BUG=None TEST=vbutil_what_keys on eve image.bin Change-Id: Iaf07ad3f419f5e79584391a2b846100e3fae61dc Reviewed-on: https://chromium-review.googlesource.com/1156326 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* image_signing: strip_boot: support device node inputsMike Frysinger2018-07-272-10/+15
| | | | | | | | | | | | | | | | To speed things up, support stripping /boot from a rootfs block device. This way we can mount an image via loopback and pass that in directly. BRANCH=None BUG=chromium:714598 TEST=strip_boot_from_image.sh on image files works, and on loopback partitions Change-Id: Ie74d3f239ac29533f4325d0c1f75e3cce5fab7a5 Reviewed-on: https://chromium-review.googlesource.com/1152075 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org> Reviewed-by: Chris Ching <chingcodes@chromium.org>
* vboot_reference: Claim space for OOBE autoconfig public keyTudor Brindus2018-07-271-0/+4
| | | | | | | | | | | | | | | This commit claims a TPM space for a 33-byte P256 EC compressed public key used in OOBE autoconfig validation. BUG=chromium:793878 TEST=make runtests; precq BRANCH=none Change-Id: I12bf8243ceb2a0029b015964ea7a2ae2f56bb080 Reviewed-on: https://chromium-review.googlesource.com/1149073 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Tudor Brindus <tbrindus@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* signer: fix accessory_rwsig signingstabilize-10895.Bstabilize-10895.56.Brelease-R69-10895.BNick Sanders2018-07-201-3/+9
| | | | | | | | | | | | | | | | | Require that the container passed in is the one containing the specified key, and no other key. So if only one key is present it must be the specified key. BUG=chromium:863464 TEST=run locally BRANCH=None Change-Id: Ieeca5773f35b7bf92beae8a2192ed6e6fd9008e6 Reviewed-on: https://chromium-review.googlesource.com/1136910 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* image_singing: Add '--nodefault_rw_root' for make_dev_ssd.sh.Hung-Te Lin2018-07-201-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | When the root is default RW mounted, we found that the system is more fragile due to suspend and resume tests. It is found that in early builds, many projects tend to need minor fixes in test image rootfs, for example kernel modules or files read by kernel. Currently the only way to update those files is to reflash whole images, but that's not very practical when the network in manufacturing line is pretty slow. It would be better if we can change a single file. As a result, we want to allow setting the default root mount option when running make_dev_ssd.sh. The new --nodefault_rw_root allows disabling rootfs verification but still mounting rootfs as RO, which makes better chances for system to be stable, and changes can still be made by an explicit 'mount -o rw,remount /'. BUG=None TEST=./make_dev_ssd.sh --remove_rootfs_verification --nodefault_rw_root Change-Id: Ie2675e25b77e638ba6c3be8e2a2a3887a95582fc Reviewed-on: https://chromium-review.googlesource.com/1137966 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* inherit-review-settings-ok/WATCHLISTS: punt old unused filesMike Frysinger2018-07-112-14/+0
| | | | | | | | | | | | BUG=None TEST=precq passes BRANCH=None Change-Id: Ie2062b74671e5f3724cb0d2141b31b53f02123ba Reviewed-on: https://chromium-review.googlesource.com/1132412 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot_aux_fw: Add new return code to handle busy casestabilize-10866.BJett Rink2018-07-031-0/+2
| | | | | | | | | | | | | | | | | | We do not want to upgrade the TCPC firmware if the TCPC is the only source of power. Use this new return code to communicate to depthcharge that we do not want upgrade at this time. BRANCH=none BUG=b:78334391 TEST=if PS8751 is the only source of power, then upgrade will gracefully skip. Change-Id: I062c79a2d01f779c30873d48ff4301aca071cca3 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1123105 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
* nocturne-fp: copypasta script to generate keypair for signing FWNick Sanders2018-07-021-0/+16
| | | | | | | | | | | | | | | All accessories leverage the key format of Hammer therefore this script calls Hammer's one to generate a key pair and renames them. BUG=b:110880196 TEST=Run this script in the chroot. BRANCH=None Change-Id: I955f28fbe2c1dab1b5f76672c34e6022660a77ed Reviewed-on: https://chromium-review.googlesource.com/1121632 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vboot_reference: fix the build for arm64stabilize-nocturne.10828.Bstabilize-nocturne.10819.Bstabilize-atlas.10819.BAdam Kallai2018-06-141-1/+1
| | | | | | | | | | | | | | | | | Add "arm64" support to Makefile to use crossystem_arch.c implementation from host/arm/lib directory, in order to avoid the code duplication. BUG=None TEST='emerge-arm64-generic vboot_reference' works correctly BRANCH=None Change-Id: I349f8b2055c9be6ebaeb6f322e3b22260465dd5a Reviewed-on: https://chromium-review.googlesource.com/1082195 Commit-Ready: Adam Kallai <kadam@inf.u-szeged.hu> Tested-by: Adam Kallai <kadam@inf.u-szeged.hu> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* keygeneration: make the certificates valid for 10 yearsfirmware-nami-10775.Bfirmware-nami-10775.130.Bfirmware-nami-10775.108.BEdward Hyunkoo Jee2018-06-061-3/+3
| | | | | | | | | | | | | | | | | | | UEFI firmware implementations are unlikely to validate the "days". However we'd better specify a reasonable value. We learned that setting the "days" argument to a large number can cause unexpected results due to overflow. GCE team has decided to set this value as 10 years. BUG=b:62189155 TEST=None BRANCH=none Change-Id: If0375251b41e9584708355a6fd32192aa5ad0c1a Reviewed-on: https://chromium-review.googlesource.com/1088165 Commit-Ready: Edward Jee <edjee@google.com> Tested-by: Edward Jee <edjee@google.com> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* futility: Add --arch=arm64 option to vbutil_kernelAdam Kallai2018-06-011-1/+2
| | | | | | | | | | | | | | | | | | | | vbutil_kernel already supports 64bit arm architecture, but it just allows "aarch64" option. However other script, for example build_kernel_image uses ARCH environment variable, which for arm64-generic overlay is defined as "arm64". So vbutil_kernel will refuse the call. BUG=None TEST=run vbutil_kernel --arch=arm64 Check that the "Unknown architecture string: arm64" is gone BRANCH=None Change-Id: I94c547d6b6940ab8c622a6b8cff49b5f83c1fcad Reviewed-on: https://chromium-review.googlesource.com/1080529 Commit-Ready: Adam Kallai <kadam@inf.u-szeged.hu> Tested-by: Adam Kallai <kadam@inf.u-szeged.hu> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* stop statically linking crossystemMike Frysinger2018-05-311-3/+2
| | | | | | | | | | | | | | | | | Now that initramfs, firmware updater, and auto-updater are all using dynamically linked programs, there's no need to produce a static build of crossystem anymore. BUG=chromium:765499 TEST=precq passes (includes vmtests w/AU) BRANCH=None Change-Id: I5aa123e662040ff5d9f2328c0f036b648fc629fb Reviewed-on: https://chromium-review.googlesource.com/667881 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Don Garrett <dgarrett@chromium.org>