summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* futility: correct typo of "flashrom"stabilize-14589.Bstabilize-14588.98.Bstabilize-14588.14.Bstabilize-14588.123.Brelease-R101-14588.BPeter Marheine2022-03-161-1/+1
| | | | | | | | | | | BUG=none TEST=still builds BRANCH=none Change-Id: I3b244461b86c8aeec4f33ad7205157c709e0d695 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3524288 Reviewed-by: Reka Norman <rekanorman@chromium.org>
* crossystem: Add support for MTL gpiochipSubrata Banik2022-03-151-0/+2
| | | | | | | | | | | | | | | | On Meteor Lake platform, the pinctrl (gpiochip) driver label is "INTC1083:00", hence declare it properly. BUG=b:224325352 TEST=Test pending Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I9c1583972e71ae472c8b3f360eda34611c8c8f0c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3520099 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: Subrata Banik <subratabanik@chromium.org> Commit-Queue: Subrata Banik <subratabanik@chromium.org> Auto-Submit: Subrata Banik <subratabanik@chromium.org>
* futility: updater: revise building RW-recovery sectionsHung-Te Lin2022-03-111-8/+23
| | | | | | | | | | | | | | | When checking the sections to update in the RW-recovery flow, we should always check the availability before adding them to the list for updating. BUG=None TEST=build and run test BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: Id714b1db736cbf4eef879566431e5a496f319cd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3494671 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: always do partial verify (-N/--noverify-all)Hung-Te Lin2022-03-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The updater should always only update the whole image when write protection is disabled, or partial (RW) when write protection is enabled. As a result, it should be better to always turn on -N (--noverify-all) for two reasons: (1) faster partial write, and (2) prevent failure due to other processors accessing the flash in parallel. - Faster partial write: On recent x86 Chromebooks the flash size is getting bigger and bigger (for example 32M on Brya) and the RW section size is much smaller (8M on Brya). So we wasted a lot of time reading and verifying sections that we don't care (64M versus 16M) if we don't turn on -N. - Concurrent access: On recent x86 devices the system flash is shared by two processors - the CPU and the CSME. Before the ME is locked, CPU can see and access all regions - including those managed by ME/CSME. As a result, when the updater is changing the RW_SECTION, the CSME may be updating CSE_RO or CSE_RW on its own. So if we don't turn on -N, the verification will fail in CSE regions. Also revised to only set FLASHROM_FLAG_VERIFY_AFTER_WRITE one time. BUG=None TEST=make; build and run tests. BRANCH=None Change-Id: I1ebff2d7f00b85037464eff4fa5d4573f867ce44 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3505290 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: Change 'whitelabel_tag' to 'customlabel_tag'Hung-Te Lin2022-03-076-105/+117
| | | | | | | | | | | | | | | | | | | | Support new VPD name 'customlabel_tag' for the custom label program. For shipped devices (firmware is already locked and write protected) we still support the legacy name. The quirk 'allow_empty_wl_tag' also renamed to 'allow_empty_customlabel_tag'. This is usually not recommended, but given no devices have used this quirk in the CBFS quirks, it should be fine to change the quirk name. BUG=b:169766857 TEST=make; build and run test BRANCH=None Change-Id: Ia29051a4e829d853cc60488f286d575c20f52f20 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3503199 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* vboot_ref/cgpt: Move mkdir out of flashrom worker funcEdward O'Callaghan2022-03-034-18/+16
| | | | | | | | | | | | | | | | | | Small refactor to make it easier to more towards libflashrom. This makes the call site responsible for setting up the path for ReadNorFlash(). BUG=b:207808292,b:220079643 BRANCH=none TEST=`make cgpt` Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: I15fc57e5afca6206b60df92616fd4cdce63b03e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3469738 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Sam McNally <sammc@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
* vboot_ref/cgpt: Consolidate flashrom write cmd pathsEdward O'Callaghan2022-03-031-14/+15
| | | | | | | | | | | | | | | | Small refactor to make it easier to more towards libflashrom. BUG=b:207808292,b:220079643 BRANCH=none TEST=`make cgpt` Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: Ie0c7f4faee3052300b10ba2d1adce7876d7b821c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3469737 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Sam McNally <sammc@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
* futility: Support C2D2 with futility update --servo.Sam McNally2022-03-031-0/+7
| | | | | | | | | | | | | | | C2D2 is used similarly to servo micro. Mirror the servo micro logic accordingly. BUG=b:220992685 TEST=futility update --servo over C2D2 with and with servo v4 BRANCH=None Cq-Depend: chromium:3470605 Change-Id: I298fe5847abba0957fa5c2da4e1981a7da9e0428 Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3469746 Reviewed-by: Reka Norman <rekanorman@chromium.org>
* futility: updater: increase verbosity on retriesHung-Te Lin2022-03-021-2/+2
| | | | | | | | | | | | | | To get more message for debugging, we want to increase the verbosity on each retry. BUG=None TEST=build and run tests BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: I85e0fc518113a18bb1aaa39db3f58329d94b5ecb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3500326 Reviewed-by: Subrata Banik <subratabanik@chromium.org>
* vboot_ref/cgpt: Use defines for region constsEdward O'Callaghan2022-03-011-3/+7
| | | | | | | | | | | | | | BUG=b:207808292,b:220079643 BRANCH=none TEST=`make cgpt` Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: I367e44eed18c79a807bd428e50a3faf926833719 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3461097 Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Tested-by: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
* futility: updater: write multiple sections in recovery RW updateHung-Te Lin2022-03-011-6/+19
| | | | | | | | | | | | | | | | | | The write_firmware_sections now supports writing multiple sections in one invocation so we can pass all RW sections to it for the recovery update. On Brya, the total execution time may be reduced from 4 mins to 1.5 mins. BUG=b:221137867 TEST=build and run test BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: Ifbc67327a02096e027c1e2025485ebb17645a71d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3490387 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* futility: updater: allow writing multiple sections in one flash commandHung-Te Lin2022-03-011-16/+37
| | | | | | | | | | | | | | Add new function 'write_firmware_sections' so we can write update sections in one write_system_firmware (e.g., flashrom) command. BUG=b:221137867 TEST=build; and run test BRANCH=None Change-Id: Ia33ec5ac82e1c661457180ec45df6c02beae4ec3 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3490389 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* futility: flashrom_drv: support partial write for multiple regionsHung-Te Lin2022-03-015-24/+52
| | | | | | | | | | | | | | | | | | | | | | | When we have multiple regions to update, invoking flashrom_write_image multiple times will take much longer because for each write it has to read the whole flash, write and then verify whole flash (also timer calibration and programmer init/shutdown every time). As a result, we want to support writing multiple regions - just like that flashrom can take arbitrary numbers of "-i REGION". This change only extended flashrom_write_image, and the firmware updater is calling flashrom_drv multiple times. That will be addressed in the follow up changes. BUG=b:221137867 TEST=build; and run test BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: Id335cc9f816f1384f1886422efa97fe2c7b81aec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3490388 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* vboot_reference/Makefile: Fix building with USE_FLASHROM:=0Edward O'Callaghan2022-02-281-7/+10
| | | | | | | | | | | | | | | | | | Unfortunately the USE_FLASHROM build flag broke during a refactor in commit f0af257a9b333b. This flag is needed for coreboot builds. Resolve by putting relevant files under guards. BUG=b:221234560,b:220833585 BRANCH=none TEST=`USE_FLASHROM={0,1} make` Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: Ic10a3909bf070897cef7f1556deef57eba6c57f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3493527 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Martin Roth <martinroth@google.com> Commit-Queue: Martin Roth <martinroth@google.com>
* EC-EFS: Ignore NO_BOOT if EC sync isn't enabledDaisuke Nojiri2022-02-272-0/+3
| | | | | | | | | | | | | | | | | | Currently, Depthcharge prevents the kernel from being loaded if NO_BOOT flag is set. This makes sense only when EC sync is enabled. This patch makes VbSelectAndLoadKernel ignore NO_BOOT flag if VB2_CONTEXT_EC_SYNC_SUPPORTED isn't set. BUG=b:216317864 BRANCH=None TEST=None Change-Id: Ic501f430754947dfa8a2243dcb12d31232b18b75 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3433028 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* futility: updater: decide if we can use diff-image by programmerstabilize-14536.BHung-Te Lin2022-02-261-3/+21
| | | | | | | | | | | | | | | | | | | Previously we decide if the flash command can use the image_current as the diff image by comparing if the target image pointer is identical to the host image to write (cfg->image). This may not work properly if we try to write a temporary firmware image object loaded separately. A more correct way to is check if the image has the same programmer from the diff image (e.g., image_current). BUG=b:221137867 TEST=build and run futility tests. BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: Iee61cd9b47c0db4b87001bbb348f95a89495b975 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3490386 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: improve updater console outputHung-Te Lin2022-02-253-3/+22
| | | | | | | | | | | | | | | | | | | To help debugging: - Print equivalent flashrom commands when reading and writing. - Print <sys-flash> instead of <none> in 'Current system:' message. - Always print the detected model from libcrosid. - After writing to flash, print a new line. BUG=None TEST=make; build and run test BRANCH=None Change-Id: I34a73ec1c968a98a9fca649c65863aa43ca39ca8 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3461090 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* futility: check flashrom return code and bail with errorYH Lin2022-02-241-10/+28
| | | | | | | | | | | | | | | | | | | During the flashrom initialization sequence the return code is not being checked therefore there's a potential that the code moves forward with read/write operation even with outstanding error. This CL checks the return code and bail with error. BUG=b:217629892 TEST=Test futility update with multiple instances of flashrom running. BRANCH=None Signed-off-by: YH Lin <yueherngl@chromium.org> Change-Id: I0768232f6af35290ad7b3d9f479ee299bf9400e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3485520 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* futility: updater: explain that match-name quirks are now deprecatedstabilize-14532.BHung-Te Lin2022-02-221-0/+8
| | | | | | | | | | | | | | | The 'match by firmware name' should be deprecated. All new platforms should use quirk instruction files (updater_quirks) from CBFS. BUG=None TEST=None (comments only) BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: Ib66cc903b15bf3fdb44db832a010d80c40bfbaa4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3458024 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Karthikeyan Ramasubramanian <kramasub@google.com>
* futility: updater: disable quirk 'ec_partial_recovery' by defaultHung-Te Lin2022-02-221-15/+6
| | | | | | | | | | | | | | | | | | | The 'ec_partial_recovery' quirk is not very helpful today because the two underlying functions - "EC RO software sync" and "update EC RO without sysjump by flashrom" are either disabled or not well tested. As a result we should change the quirk from "decide by runtime" to "default disabled". BUG=b:218612817 TEST=make; build and run test BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: I9022b88516e52cb89f2226523a754dc2a00b15da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3458023 Reviewed-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* vboot_ref/flashrom_drv: Allow sentinel verbosity valueEdward O'Callaghan2022-02-211-2/+2
| | | | | | | | | | | | | | | | | Allow for picking the default verbosity with a sentinel value of -1. BUG=b:207808292 BRANCH=none TEST=none Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: Ia3a21e8647fe480c60ea80ecb060466e9d86110a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3461094 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Commit-Queue: Nikolai Artemiev <nartemiev@google.com>
* vboot_ref: Reshuffle parallel flashrom implEdward O'Callaghan2022-02-195-48/+62
| | | | | | | | | | | | | | | | | | | | Bring sub-process and libflashrom wrapper implementations under the common host/lib path to later be reconciled. The WP implementation is left separated out due to the lack of a libflashrom WP implementation which creates circular dependencies for the moment. BUG=b:207808292 BRANCH=none TEST=none Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: Ic759c4e9828778a0ef1443b163224aef2c7cba54 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3461093 Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
* vboot_ref: merge struct firmware_image;Edward O'Callaghan2022-02-192-14/+3
| | | | | | | | | | | | | | | BUG=b:207808292 BRANCH=none TEST=none Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: I49bd29dcfe12ad9845213d07bc6bee71980a8cd1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3461092 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-by: Sam McNally <sammc@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
* vboot_ref: Add TODO in host/lib/include/flashrom.hEdward O'Callaghan2022-02-191-0/+8
| | | | | | | | | | | | | | | BUG=b:207808292 BRANCH=none TEST=none Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: Iaf94b5cc8c7b4f4b7859f10b8078e922bc1636d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3450057 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-by: Sam McNally <sammc@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
* vboot: Add --programmer and --servo flags to {get,set}_gbb_flags.sh.stabilize-quickfix-14526.91.Bstabilize-14528.Bstabilize-14526.89.Bstabilize-14526.84.Bstabilize-14526.73.Bstabilize-14526.67.Bstabilize-14526.57.Brelease-R100-14526.BSam McNally2022-02-173-8/+63
| | | | | | | | | | | | | | | | | | | | | Allow custom programmers to be used instead of host for getting and setting GBB flags via a --programmer/-p flag similar to the same flag for futility. Also support --servo with the same semantics as the futility flag - detecting the programmer to use from the current servod instance mirroring the logic in futility. Only CCD is supported at this stage. When reading, include the FMAP section as well as the GBB section. For writes over CCD, avoiding rescanning for the FMAP can save up to 1.8s. BUG=None TEST={get,set}_gbb_flags.sh --servo with and without servod running BRANCH=None Change-Id: Iecedf4c3d0cad6923aed4405ef4a72910f3f9f05 Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3455562 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* vboot_reference: lib/flashrom convert args into structEdward O'Callaghan2022-02-145-79/+92
| | | | | | | | | | | | | | | | | | | | This attempts to converge the signatures of host/lib/flashrom with that of 'futility/updater_utils.h:struct firmware_image'. with the eventual goal of converging the multiple flashrom wrapper implementations. BUG=b:207808292 BRANCH=none TEST=`$ cros_run_unit_tests --board nocturne --packages vboot_reference` Cq-Depend: chromium:3399963 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: I016dacbdca6f1108def0dbc608d83e0066a30023 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3301571 Reviewed-by: Sam McNally <sammc@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
* futility: updater: add new quirk 'extra_retries'Hung-Te Lin2022-02-145-11/+41
| | | | | | | | | | | | | | | | | In early bring up, some devices may have problem when flashrom is reading or writing to the system flash. To unblock dogfood process, we want to have a special quirk to retry flashing. BUG=b:213706510 TEST=make; build and run test BRANCH=None Change-Id: I58788f620fb32f7c886d1e5638f4a3605ea77953 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3452846 Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* futility/updater: Ignore preserve_me quirks for non-host programmers.Sam McNally2022-02-132-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | The preserve_me quirk allows avoiding modifying the ME region while it may be running. Its apply function attempts to skip itself when not flashing the OS-bundled firmware by checking for whether an archive is set, but this doesn't work since in the absence of an actual archive file, a filesystem archive implementation is used instead. While flashing over a non-host programmer the ME is not running and therefore it is safe to update the ME region. Add unit test cases for the preserve_me quirk applying successfully when using the default host programmer and being skipped when using another programmer. BUG=b:213706510 TEST=futility update -p dummy... with preserve_me quirk skips the quirk; chromeos-firmwareupdate with a preserve_me quirk applies the quirk BRANCH=none Change-Id: Ie5578c9b3cf7eba55626bb931589bf360fe28269 Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3450060 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* make_dev_ssd.sh: Update grub defaultA and defaultBJeffery Miller2022-02-111-2/+3
| | | | | | | | | | | | | | | | | | | | | Update the defaultA=2 and defaultB=3 grub settings to remove verification. In change I930d0f3f1a3f8f54edd1dce7f8259e3c261af9a1 the default options for grub were changed to be defaultA and defaultB instead of 'set default=2'. Update the removal to support these new configuration settings. BRANCH=none BUG=b:186240229 TEST=on a reven build run `/usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --force`; reboot and confirm verity is disabled Change-Id: I70ceed432c29865715c525a6ae13f0e7da8ee0ba Signed-off-by: Jeffery Miller <jefferymiller@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3445175 Reviewed-by: Nicholas Bishop <nicholasbishop@google.com> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Nicholas Bishop <nicholasbishop@google.com>
* futility: updater: prevent unexpected update for the RW_LEGACY sectionHung-Te Lin2022-02-081-5/+7
| | | | | | | | | | | | | | | | | | | When updating the legacy section, we have to check the existence of 'cros_allow_auto_update' in both 'from' and 'to' images, and only update if they both have the correct tag file. BUG=b:215175246,chromium:1169544 TEST=make; build and run test BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: I81f62f42cf9a6f6f1931e05cd07131b569ad0cb0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3404063 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* sign_official_build: Sign hps_firmwareEvan Benn2022-02-081-0/+3
| | | | | | | | | | | | | | | | BUG=b:204378599 TEST=None BRANCH=None Signed-off-by: Evan Benn <evanbenn@chromium.org> Cq-Depend: chrome-internal:4473134 Change-Id: I2316ec9e75e854352350e90055e717a258c43f6e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3388968 Tested-by: Evan Benn <evanbenn@chromium.org> Auto-Submit: Evan Benn <evanbenn@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Evan Benn <evanbenn@chromium.org>
* futility: drop sudo from test scriptstabilize-14498.Bstabilize-14496.Bfirmware-brya-14505.71.BNikolai Artemiev2022-02-011-2/+2
| | | | | | | | | | | | | | Command does not need to run under sudo and sudo will not be available once we start running the test scripts under platform2_test.py. BUG=b:207787495 BRANCH=none TEST=`cros_run_unit_tests --board grunt --packages vboot_reference` Signed-off-by: Nikolai Artemiev <nartemiev@google.com> Change-Id: I795519c4b45e410f5ddc3c55dceab1ae1de02dbc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3428421 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* futility: updater: add new quirk 'no_verify'Hung-Te Lin2022-01-293-0/+17
| | | | | | | | | | | | | | | | | | Some devices in early dogfood stage may need to skip verifying flashed firmware contents, for example due to CSE updating itself. This should not be a long term solution - only for debugging or testing in early development. BUG=b:213706510 TEST=build and test BRANCH=none Change-Id: I04a79f6762a0c556d82d0062e5cf5c9b3e0cfc4f Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3419417 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org>
* crossystem: Add support for ADL-N gpiochipSubrata Banik2022-01-281-0/+1
| | | | | | | | | | | | | | | | | | On Alder Lake-N platform, the pinctrl (gpiochip) driver label is "INTC1057:00", hence declare it properly. BUG=b:213535859 TEST=run 'crossystem wpsw_cur' and see '0' rather than an error on ADLRVP platform. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: Ie742a43cd37b37a35b16e68fe4be44f9bb08ec5c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3404067 Reviewed-by: Subrata Banik <subratabanik@chromium.org> Tested-by: Subrata Banik <subratabanik@chromium.org> Auto-Submit: Subrata Banik <subratabanik@chromium.org> Reviewed-by: Kangheui Won <khwon@chromium.org> Commit-Queue: Kangheui Won <khwon@chromium.org>
* futility: updater: use diff image when preserving MEHung-Te Lin2022-01-281-0/+9
| | | | | | | | | | | | | | | | | | On recent Intel platforms with CSE, the ME/CSE may change the preserved area (for example copying ME_RW_A/CSE_RW to CSE_RO) during firmware update. As a result, we want to use the diff image instead of real system firmware contents when updating. BUG=b:213706510 TEST=build and run test BRANCH=None Change-Id: Ib75d9ebb707e240fcbb77ac72d2c08b8c6889532 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3404062 Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Nick Vaccaro <nvaccaro@google.com> Commit-Queue: YH Lin <yueherngl@chromium.org>
* accessory: script to generate hps keysEvan Benn2022-01-261-0/+64
| | | | | | | | | | | | | | | | hps uses ed25519 keys so generate a pair of that type. BUG=b:214495498 TEST=./create_new_hps_key.sh BRANCH=none Signed-off-by: Evan Benn <evanbenn@chromium.org> Change-Id: I3f63ea5852b8e5959b7577e8b988284da043b449 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3394031 Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Evan Benn <evanbenn@chromium.org> Tested-by: Evan Benn <evanbenn@chromium.org>
* futility: updater: allow changing GBB flags on erased flashHung-Te Lin2022-01-261-4/+12
| | | | | | | | | | | | | | | | | The --gbb_flags supports changing GBB flags but the value will be ignored if the device flash was erased (e.g., no valid GBB section). To fix that we should check the 'to' and 'from' flash contents separately when preserving GBB data. BUG=b:216295706 TEST=build; emerge test BRANCH=None Change-Id: Ie02138dd4234b461ca1913bef1cabde8becf57c9 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3414190 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: split 'fast update' into 'diff image' and 'no verify'Hung-Te Lin2022-01-255-10/+17
| | | | | | | | | | | | | | | | | | Some special quirks (for example preserving ME) may want to use diff image but still do verification, so we want to change 'fast_update' config into two flags: 'do_verify' and 'use_diff_image'. BUG=b:213706510 TEST=build BRANCH=None Change-Id: Ia0160918ac58110850dd7f622610398ebfb92b47 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3404061 Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* accessory: make create_new_hammer_like_keys generates correct key namestabilize-14477.BTing Shen2022-01-212-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | create_new_hammer_like_keys.sh generates a key pair with hard-coded filename "key_hammerlike.*". And we usually ask the croskeymanagers team to manually rename it to the correct device name (e.g. b:213403966). The manual step sometimes confuses people. Modify the script to make create_new_hammer_like_keys.sh takes an extra keyname argument and generates the correct filename at once. BUG=b:213922329 TEST=1) normal usage ./create_new_hammer_like_keys.sh foo 2) error (two keyname provided) ./create_new_hammer_like_keys.sh foo bar 3) error (missing keyname) ./create_new_hammer_like_keys.sh 4) also check efs keygen ./create_new_ec_efs_key.sh BRANCH=none Change-Id: I2a2e24b77961ea2d744ac65d835446a74381e004 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3398389 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Add vboot_reference-sysstabilize-wristpin-14469.59.Bstabilize-14469.9.Bstabilize-14469.8.Bstabilize-14469.58.Bstabilize-14469.41.Brelease-R99-14469.BAllen Webb2022-01-199-0/+116
| | | | | | | | | | | | | This adds Rust bindings to vboot_reference. BRANCH=none BUG=b:214081328 TEST=cargo build Change-Id: I4f9df36a0de93c0617ead2a75ef2ca5fcf8f5652 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3390514 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vboot_reference/cgpt_nor: Make ForkExecL() static localfactory-cherry-14455.BEdward O'Callaghan2022-01-131-1/+1
| | | | | | | | | | | | | | BUG=none TEST=builds Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: Ied809d3c2839f33d738d1938cafd6c634d54ee28 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3353558 Commit-Queue: Edward O'Callaghan <quasisec@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Commit-Queue: Nikolai Artemiev <nartemiev@google.com>
* futility: Use crosid to probe firmware manifest keyJack Rosenthal2022-01-111-17/+53
| | | | | | | | | | | | | | | | | | | | | | Use the API function crosid_get_firmware_manifest_key from libcrosid instead of "mosys platform model" to get the firmware manifest key. Note: this leaves inconsistent terminology around "model" and "firmware manifest key", which is quite intentional at the moment, since the model is still the firmware manifest key for the time being. Should we decide to change that in the future, we can do further renaming in futility. BUG=b:213251232 BRANCH=none TEST=chromeos-firmwareupdate on delbin run recovery on delbin Cq-Depend: chromium:3364974 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I306ae444849e327ba208f52e34b584b571ef6a3c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3368704 Reviewed-by: Raul Rangel <rrangel@chromium.org>
* futility: Link with libcrosidJack Rosenthal2022-01-101-1/+7
| | | | | | | | | | | | | | | | | | | Use pkg-config to link with libcrosid when it's available. Note that when futility is compiled from the coreboot tree, libcrosid won't be available, at least at the moment, so expose -DUSE_CROSID to the C code so we know when we have it available. BUG=b:213251232 BRANCH=none TEST=emerge-volteer -j vboot_reference "lddtree /build/volteer/usr/bin/futility" lists libcrosid Cq-Depend: chromium:3367251 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I8e69c5ce4570ac9df72440d0a34b6b03b5a36e77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3368703 Reviewed-by: Raul Rangel <rrangel@chromium.org>
* crossystem: Remove the stale TPM simulator supportYi Chou2022-01-102-23/+3
| | | | | | | | | | | | | | | | We don't need the MOUNT_ENCRYPTED_KEY_PATH after we replaced the stale TPM simulator with the driver-level TPM simulator. It's time to remove it. BUG=b:203195852, b:174807059 BRANCH=none TEST=crossystem clear_tpm_owner_request=1 Signed-off-by: Yi Chou <yich@google.com> Change-Id: I7c1c9c16697b1bbda9adea13448fdb9cffd9cc7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3358669 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Leo Lai <cylai@google.com>
* crossystem: Add flock to prevent race conditionsYi Chou2022-01-101-5/+69
| | | | | | | | | | | | | | | | The crossystem command would have potential race conditions when we calling this command in parallel. Add a flock should prevent this issue. BUG=b:172876417 BRANCH=none TEST=Firing multiple crossystem commands, and check result Signed-off-by: Yi Chou <yich@google.com> Change-Id: Ia9f8a73d5fd762c79088f350ea05d0dd540f3fc3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3358668 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Leo Lai <cylai@google.com>
* vboot_reference/futility: Pass through SERVOD_NAME.Sam McNally2022-01-072-2/+7
| | | | | | | | | | | | | | | SERVOD_PORT and SERVOD_NAME environment variables are both used by dut-control to identify the servod instance to use. If SERVOD_NAME is set, query the servo serial number just like when SERVOD_PORT is set. BUG=None TEST=futility --servo -i with SERVOD_NAME set BRANCH=None Change-Id: I0c656e25d4f5da67570e3ff7d6cf28fdca5ec1cf Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3367518 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* vboot_reference/futility: Support "ccd_gsc" as a servo type fragment.Sam McNally2022-01-071-2/+3
| | | | | | | | | | | | | | For DT, servo_type reports ccd_gsc instead of ccd_cr50. Treat ccd_gsc the same as ccd_cr50. BUG=None TEST=futility update --servo -i BRANCH=None Change-Id: I27f5ea7ccc70fd1a247b844a9929aed7a133ebb3 Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3367517 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* Makefile: Fix missed boolean flagsstabilize-14442.BJakub Czapiga2022-01-041-4/+4
| | | | | | | | | | | | | | | | Fix flags missed in CL:3306615. BUG=b:206031372 TEST=make runtests TEST=sudo emerge-guybrush sys-boot/depthcharge BRANCH=none Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: Idbb205bb9e14f44a10806785fb9f7b29572f0626 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3347667 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Jakub Czapiga <czapiga@google.com> Commit-Queue: Jakub Czapiga <czapiga@google.com>
* vboot_reference: Allow flashrom_read_image() reading per-regionstabilize-14438.BEdward O'Callaghan2022-01-043-3/+34
| | | | | | | | | | | | | | BUG=b:207808292 BRANCH=none TEST=`make` Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: I98f1a2566ef50b2c7b1376141bb2f1c096b710a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3358664 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Commit-Queue: Nikolai Artemiev <nartemiev@google.com>
* 2lib: Deprecate vb2api_allow_recovery() and VB2_SD_FLAG_MANUAL_RECOVERYHsuan Ting Chen2021-12-307-72/+48
| | | | | | | | | | | | | | | | | | | | | | | | 2lib used vb2_api_allow_recovery() to differentiate between manual and non-manual recovery in 2kernel and UI related areas. With introducing the ctx->boot_mode, we could decide if it is a manual recovery or a broken screen (a.k.a non-manual recovery in the original design) once in vb2api_fw_phase1 and use this boot mode instead for further justifications. Also deprecate the sd flag VB2_SD_FLAG_MANUAL_RECOVERY and use the boot mode instead to determine if it is a manual recovery boot. BUG=b:181931817 BRANCH=none TEST=make clean && make runtests TEST=emerge coreboot vboot_reference depthcharge Cq-Depend: chromium:3282875 Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: Ief4ff6cf82285c5857f0051c1f348ad0f269b4a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3121926 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>