diff options
author | Hung-Te Lin <hungte@chromium.org> | 2022-01-27 10:30:13 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-29 01:03:41 +0000 |
commit | 8d2ec2700398f7d3363ebd194e697ae7358b5028 (patch) | |
tree | b8eede8b09c577848905a853b5bdc2db7cd4821e | |
parent | 1e4abafb5ecd3bba89f49a5a076df10ba5a0aaad (diff) | |
download | vboot-8d2ec2700398f7d3363ebd194e697ae7358b5028.tar.gz |
futility: updater: add new quirk 'no_verify'
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>
-rw-r--r-- | futility/updater.c | 1 | ||||
-rw-r--r-- | futility/updater.h | 1 | ||||
-rw-r--r-- | futility/updater_quirks.c | 15 |
3 files changed, 17 insertions, 0 deletions
diff --git a/futility/updater.c b/futility/updater.c index d58ea399..46f8878a 100644 --- a/futility/updater.c +++ b/futility/updater.c @@ -1198,6 +1198,7 @@ enum updater_error_codes update_firmware(struct updater_config *cfg) image_to->file_name, image_to->ro_version, image_to->rw_version_a, image_to->rw_version_b); + try_apply_quirk(QUIRK_NO_VERIFY, cfg); if (try_apply_quirk(QUIRK_MIN_PLATFORM_VERSION, cfg)) { if (!cfg->force_update) { ERROR("Add --force to waive checking the version.\n"); diff --git a/futility/updater.h b/futility/updater.h index 721f09f1..2562782b 100644 --- a/futility/updater.h +++ b/futility/updater.h @@ -47,6 +47,7 @@ enum quirk_types { QUIRK_OVERRIDE_SIGNATURE_ID, QUIRK_PRESERVE_ME, QUIRK_NO_CHECK_PLATFORM, + QUIRK_NO_VERIFY, QUIRK_MAX, }; diff --git a/futility/updater_quirks.c b/futility/updater_quirks.c index 5d996ad5..1f7fada9 100644 --- a/futility/updater_quirks.c +++ b/futility/updater_quirks.c @@ -434,6 +434,16 @@ static int quirk_no_check_platform(struct updater_config *cfg) } /* + * Disable verifying contents after flashing. + */ +static int quirk_no_verify(struct updater_config *cfg) +{ + WARN("Disabled verifying flashed contents. You are on your own.\n"); + cfg->do_verify = 0; + return 0; +} + +/* * Registers known quirks to a updater_config object. */ void updater_register_quirks(struct updater_config *cfg) @@ -497,6 +507,11 @@ void updater_register_quirks(struct updater_config *cfg) quirks->name = "no_check_platform"; quirks->help = "Do not check platform name."; quirks->apply = quirk_no_check_platform; + + quirks = &cfg->quirks[QUIRK_NO_VERIFY]; + quirks->name = "no_verify"; + quirks->help = "Do not verify when flashing."; + quirks->apply = quirk_no_verify; } /* |