summaryrefslogtreecommitdiff
path: root/futility/updater_utils.c
Commit message (Collapse)AuthorAgeFilesLines
* futility: updater: add new quirk 'external_flashrom'stabilize-voshyr-14637.Bstabilize-14633.Bstabilize-14616.Bfactory-guybrush-14600.BHung-Te Lin2022-03-181-4/+2
| | | | | | | | | | | | | | | The new quirk will allow the updater to easily switch the underlying flash driver between the libflashrom and the external flashrom. BUG=None TEST=build and run test BRANCH=None Change-Id: I5b9da373b1e22a948e04d844973a5683adffe63c Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3534489 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: support external flashromHung-Te Lin2022-03-181-22/+156
| | | | | | | | | | | | | | | | | | | The libflashrom is still different from the real flashrom program. To easily debug and compare the execution results (especially for devices under development), we want to allow the updater to switch between the libflashrom and the external flashrom. The real switch (either a quirk or a command line argument) will be added in a follow up change. BUG=None TEST=build and run test BRANCH=None Change-Id: I3f3226fd555dc9e7c40838cd1474e0d018b27ccc Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3500339 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: refactor {write,load}_system_firmwareHung-Te Lin2022-03-181-44/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | The 'write_system_firmware' and 'load_system_firmware' have too many parameters that are already contained in the updater_config. To simplify the interfaces, we should just pass the updater_config to {write,load}_system_firmware, and merge the write_firmware_sections (only handling emulation and deciding the diff image) to the write_system_firmware. Also moved the utility functions only used by *_system_firmware (for example is_the_same_programmer and emulate_write_firmware) to the updater_utils.c. The emulate_write_firmware is also revised to handle a list of sections directly (so we don't need to handle that in write_system_firmware). BUG=None TEST=make; build and run test. BRANCH=None Change-Id: I4d123d12e8057da82d6c301899472e3773f3266e Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3508121 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* 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>
* 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>
* futility: flashrom_drv: support partial write for multiple regionsHung-Te Lin2022-03-011-9/+27
| | | | | | | | | | | | | | | | | | | | | | | 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>
* futility: updater: improve updater console outputHung-Te Lin2022-02-251-0/+17
| | | | | | | | | | | | | | | | | | | 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: updater: add new quirk 'extra_retries'Hung-Te Lin2022-02-141-6/+18
| | | | | | | | | | | | | | | | | 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: split 'fast update' into 'diff image' and 'no verify'Hung-Te Lin2022-01-251-2/+3
| | | | | | | | | | | | | | | | | | 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>
* vboot_reference/futility: Pass through SERVOD_NAME.Sam McNally2022-01-071-2/+4
| | | | | | | | | | | | | | | 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>
* vboot_reference: Allow flashrom_read_image() reading per-regionstabilize-14438.BEdward O'Callaghan2022-01-041-1/+1
| | | | | | | | | | | | | | 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>
* vboot_ref/futility: Extract out flashrom call logicEdward O'Callaghan2021-12-241-188/+9
| | | | | | | | | | | | | | | | | | Separate out all the flashrom worker code used in futility to allow for later building a futility without flashrom support. BUG=b:203715651,b:209702505 BRANCH=none TEST=builds Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: I938141056424f8f93a598bbb288ee7c8770edc95 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3350298 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
* vboot_reference/futility: Inline get_host_wp()Edward O'Callaghan2021-11-261-89/+26
| | | | | | | | | | | | | | | | | | | | | writeprotect still requires sub-processing flashrom as libflashrom currently lacks a API to perform this task. Therefore simplify the remaining sub-process logic for just this purpose. BUG=b:203715651 BRANCH=none TEST=cros deploy to nocturne and ran: `/usr/sbin/chromeos-firmwareupdate --mode=recovery --wp=1`. && `$ cros_run_unit_tests --board nocturne --packages vboot_reference`. Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: I11c0f89997e3f47e97444cc8186823fa536b8d5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3233704 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-by: Sam McNally <sammc@chromium.org>
* vboot_reference/futility: pipe log level thoughEdward O'Callaghan2021-11-251-12/+8
| | | | | | | | | | | | | | | | | Also drop colour support at reviewers request. BUG=b:203715651 BRANCH=none TEST=cros deploy to nocturne and ran: `/usr/sbin/chromeos-firmwareupdate --mode=recovery --wp=1`. && `$ cros_run_unit_tests --board nocturne --packages vboot_reference`. Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: Ie1d1b1e8e304d21ac1df741a3b789cb49ede3556 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3244680 Commit-Queue: Edward O'Callaghan <quasisec@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Sam McNally <sammc@chromium.org>
* vboot_reference/futility: Port R path to using libflashromEdward O'Callaghan2021-11-251-24/+33
| | | | | | | | | | | | | | | | | | | | | | Use libflashrom API over sub-processing the flashrom CLI. Squash in, Use buffer instead of temp file in load_system_firmware(). BUG=b:203715651 BRANCH=none TEST=cros deploy to nocturne and ran: `/usr/sbin/chromeos-firmwareupdate --mode=recovery --wp=1`. && `$ cros_run_unit_tests --board nocturne --packages vboot_reference`. Cq-Depend: chromium:3295109 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: Ib78f7aa6606adb8d5ce72282c55b8e3b9e3b3cde Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3247853 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Sam McNally <sammc@chromium.org>
* vboot_reference/futility: set layout when using regionNikolai Artemiev2021-11-241-0/+1
| | | | | | | | | | | | | | | Possible fix for flashrom trying to write whole flash. BUG=b:207359246 BRANCH=none TEST=builds Signed-off-by: Nikolai Artemiev <nartemiev@google.com> Change-Id: I69f40a46d3004a2cb4c675ff79854287f7f50766 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3295638 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org>
* vboot_reference/futility: Port W path to using libflashromEdward O'Callaghan2021-11-181-29/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | Use libflashrom API over sub-processing the flashrom CLI. Squash in, vboot_reference/futility: Use image layout as fallback Use the layout encoding within the image as the fallback if we cannot read it from ROM. Also cleanup error paths while here. BUG=b:203715651 BRANCH=none TEST=cros deploy to nocturne and ran: `/usr/sbin/chromeos-firmwareupdate --mode=recovery --wp=1`. && `$ cros_run_unit_tests --board nocturne --packages vboot_reference`. Cq-Depend: chromium:3249690, chromium:3281062, chromium:3288610 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: I892aec510d8023abd42a07cbb036be79bc8b4498 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3247852 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Sam McNally <sammc@chromium.org>
* vboot_reference/futility: Split load_firmware_image() fnstabilize-14312.BEdward O'Callaghan2021-10-281-29/+36
| | | | | | | | | | | | | | | | | | | | | This is in prep for removing the need for temp files. V.2: Move validation into parse_firmware_image() BUG=b:203715651 BRANCH=none TEST=cros deploy to nocturne and ran: `/usr/sbin/chromeos-firmware --mode=recovery`. Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: Id61fcb0f53546a78085e0a367c21780c5885bc51 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3244679 Commit-Queue: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Sam McNally <sammc@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Sam McNally <sammc@chromium.org>
* portability fixes: support building vboot on OpenBSDstabilize-13983.Bstabilize-13982.88.Bstabilize-13982.82.Bstabilize-13982.70.Bstabilize-13982.69.Bstabilize-13982.60.Bstabilize-13982.51.Brelease-R92-13982.BIdwer Vollering2021-05-201-1/+1
| | | | | | | | | | | This was done on OpenBSD 6.8. Required packages are: e2fsprogs and gcc. Change-Id: I86ec080e1ddb90053d81f1edd17d3406e7e737c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2903352 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* vboot_reference: migrate out of flashrom deprecated optionsDaniel Campello2021-04-281-1/+1
| | | | | | | | | | | | | | This change replaces --diff and --fast-verify for the supported equivalent flashrom options BRANCH=none BUG=b:186479007 TEST=tryjobs Change-Id: I614ba71c606dbe4e3a1b4988df845bcbbd61dd01 Signed-off-by: Daniel Campello <campello@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2853623 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* futility: updater: print flashrom execution logs on read failurestabilize-13505.1.BHung-Te Lin2020-09-261-0/+11
| | | | | | | | | | | | | | | | | | To prevent flooding AU logs, we don't want flashrom to print verbose logs especially when reading system SPI flash. However, if anything goes wrong it will be very helpful to have all the messages logged. With this patch, we will try reading system flash again with max verbosity. BUG=chromium:943262,b:169026171 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I5469182f2628855e65546bef3abf8791261aabca Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1545598 Commit-Queue: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* portability fixes: support building vboot on FreeBSDIdwer Vollering2020-09-111-0/+3
| | | | | | | | | | | Built on FreeBSD 12.1-RELEASE, 13-CURRENT, using gcc9 installed from packages. Change-Id: Ifa8bb343c7e916c1b545cf6c1e4bd0a18ea391cd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2382790 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org>
* flashrom: set umask before creating temporary filesJack Rosenthal2020-07-201-0/+6
| | | | | | | | | | | | | | | Good security practice. Set to 077; resultant file permissions are: -rw------- BUG=b:160717634 BRANCH=none TEST=unit tests Change-Id: Ib3b853c824be4c98e7b9ddd31797104ec4ab67a9 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2302962 Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* futility: updater: Add '--servo_port' to select from multiple servodsHung-Te Lin2020-06-061-8/+35
| | | | | | | | | | | | | | | | | | | | | | | When multiple servo boards are connected to the host, we usually want to select the right servo by specifying its port, get the servo serial number, and pass that to flashrom programmer. The new --servo_port (or environment variable SERVOD_PORT) now allows developers to flash firmware via specific servod using futility updater easily: futility update --servo_port 9998 -i PATH_TO/image.bin BRANCH=None BUG=None TEST=make runtest; sudo futility update --servo_port 9998 -i image.bin Change-Id: Ic302f841abf745801995ff233fc209726ed039c8 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2228258 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Douglas Anderson <dianders@chromium.org>
* updater: Replace servo-v2 with google-servo-v2Nicolas Boichat2020-05-181-1/+1
| | | | | | | | | | | | | | servo-v2 will eventually be deprecated. BRANCH=none BUG=b:145175076 TEST=Flash with servo v2, no more "Warning: Use 'google-servo-v2' instead!" Change-Id: Ie7ae9e173a7cbe0fcd37d1c88b5746fb89cc8e22 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2206094 Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* vboot: stop using wpsw_boot and remove it from crossystemJoel Kitching2020-02-271-7/+1
| | | | | | | | | | | | | | | | | | wpsw_boot is being deprecated, so just use wpsw_cur. BUG=b:124141368, chromium:950273 TEST=make clean && make runtests BRANCH=none Change-Id: Iae63b2a76b19629a9ecd9b87e5dd6367767860b3 Cq-Depend: chromium:2066154, chromium:2068241, chromium:2068209 Cq-Depend: chromium:2068297, chromium:2067229, chromium:2067231 Cq-Depend: chromium:2068242 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2066192 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* futility: updater: Fix failure by modifying released memoryHung-Te Lin2020-02-261-1/+1
| | | | | | | | | | | | | | | When deleting the temp files, the pointer to released head must not be used again. Setting 'next' to NULL should be done earlier. BUG=chromium:1055468 TEST=make clean && make runfutiltests BRANCH=none Change-Id: Ia4356ade5fcf85e2bfc917c5a3bcbb7f492c5a08 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2071179 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
* futility: updater: Ignore image parsing error in --forceHung-Te Lin2020-02-211-34/+55
| | | | | | | | | | | | | | | | | | | | The firmware updater has been improved to support flashing outside DUT (--ccd, --servo) that also implies more people will use it for devices with corrupted (or empty) firmware. It's pretty confusing for developers to see "Cannot load system active firmware" while the flashrom can actually read and write to the SPI firmware. The solution here is to allow updating on such devices when --force is specified (which is automatically applied for --servo and --ccd). BUG=b:148405957 TEST=make runtests BRANCH=None Change-Id: I19e63e3464616bc508639cbfad0d1cf8e99507b0 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2059621 Reviewed-by: Joel Kitching <kitching@chromium.org>
* futility: updater: Add '--servo' for updating via Servo-V2 and ServoMicroHung-Te Lin2020-01-201-0/+36
| | | | | | | | | | | | | | | | | | | | | Flashing via Servo V2 and Servo Micro was known to be a complicated. With the new virtual control 'cpu_fw_spi' we have a better way to prepare servo in an unified way. The new '--servo' will detect servo type and pick up the right params (for servo v2, servo micro, servo v4 with ccd, or servo v4 + micro) for programming. BRANCH=None BUG=None TEST=make runtest; sudo futility update --servo -i image.bin Cq-Depend: chromium:1966176 Change-Id: Ia14288b1bd5f24acfc4fb85ba64c2c445152a3a7 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1966872 Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* futility: updater: override signature id for phaser360Paul Ma2020-01-081-0/+26
| | | | | | | | | | | | | | | | | | | | | | Because of lacking CL:1501614 in octopus factory branch, dopefish root key is written to some phaser360 devices. That will lead to firmware updater not be able to verify RW vblock and AU will fail. This CL will fix that by using root key info and model name to make firmware updater get a proper sig_id so that in-field machines can be updated by AU. BUG=b:146876241, b:133901651, b:146482979 BRANCH=none TEST=using a DUT of phaser360 (without whitelabel_tag = dopefish) which is flashed dopefish rootkey and hwid, using command 'chromeos-firmwareupdate -m autoupdate --wp=1' to flash firmware, RW firmware can be updated and DUT can boot normally. Change-Id: I163c16189c28a996ed08bf2a7b162e6ee3b13be6 Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1981650 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
* futility: updater: refactor: unify getting temp files for firmware imagesHung-Te Lin2019-11-271-1/+3
| | | | | | | | | | | | | | | | Unify "create a temp file and write firmware image contents" to the new API get_firmware_image_temp_file with better error messages. BRANCH=none BUG=chromium:1024401 TEST=make clean && make runtests Change-Id: I441f24053a8d94def587cf8270c44a4bdce9a4fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1928359 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Auto-Submit: Hung-Te Lin <hungte@chromium.org>
* futility: updater: refactor: isolate tempfile functions from updater_configHung-Te Lin2019-11-221-45/+66
| | | | | | | | | | | | | | | | | | | | The updater_utils.c should not deal with updater_config directly. Currently everything relates to generating temporary files will need updater_config due to updater_create_temp_file. By moving that out (let every caller to pass &cfg->tempfiles) we can detach updater_utils.c from updater_config. BRANCH=none BUG=chromium:1024401 TEST=make clean && make runtests Change-Id: I44bc4df0152596a822b1e0672f41c16825472249 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1928358 Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Auto-Submit: Hung-Te Lin <hungte@chromium.org>
* futility: updater: move system-related utility functions to updater_utilsHung-Te Lin2019-11-221-0/+641
The firmware updater (updater.c) is bloated so we should move functions that are not really related to 'updating logic' to a new file, updater_utils.c. Refactor only by moving functions (and renamed few functions), no changes in updater logic. BRANCH=none BUG=chromium:1024401 TEST=make clean && make runtests Change-Id: I98339c5c4a81845b36daf842c79625fa2389c7f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1926009 Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Auto-Submit: Hung-Te Lin <hungte@chromium.org>