summaryrefslogtreecommitdiff
path: root/futility/updater_utils.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>