summaryrefslogtreecommitdiff
path: root/futility/updater_utils.c
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2022-03-18 14:19:16 +0800
committerCommit Bot <commit-bot@chromium.org>2022-03-18 20:43:53 +0000
commit26187f1d4e2534fe9d2fe90e7ce82af23ada1866 (patch)
tree8a9327ae1d77f03c9532a89185b4e338c4e40907 /futility/updater_utils.c
parent67d21be99c7ce35bc0580c4fd4e062da90bd1cbb (diff)
downloadvboot-26187f1d4e2534fe9d2fe90e7ce82af23ada1866.tar.gz
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>
Diffstat (limited to 'futility/updater_utils.c')
-rw-r--r--futility/updater_utils.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/futility/updater_utils.c b/futility/updater_utils.c
index a581c8f6..762be7c4 100644
--- a/futility/updater_utils.c
+++ b/futility/updater_utils.c
@@ -715,8 +715,7 @@ static int external_flashrom(enum flash_command flash_cmd,
static int read_flash(struct flashrom_params *params,
struct updater_config *cfg)
{
- /* TODO(hungte): Add a quirk to allow switching to external flashrom. */
- if (0)
+ if (get_config_quirk(QUIRK_EXTERNAL_FLASHROM, cfg))
return external_flashrom(FLASH_READ, params, &cfg->tempfiles);
return flashrom_read_image(params->image, NULL, params->verbose);
@@ -727,8 +726,7 @@ static int write_flash(struct flashrom_params *params,
{
int r;
- /* TODO(hungte): Add a quirk to allow switching to external flashrom. */
- if (0)
+ if (get_config_quirk(QUIRK_EXTERNAL_FLASHROM, cfg))
return external_flashrom(FLASH_WRITE, params, &cfg->tempfiles);
r = flashrom_write_image(params->image,