diff options
author | Hung-Te Lin <hungte@chromium.org> | 2019-11-20 16:50:16 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-21 22:59:49 +0000 |
commit | a31ad0c3befcb93cc0e720c94919b203d5ff56ba (patch) | |
tree | e785bc99b72b9ff5e0992f8d53b9a19bbf3aa765 | |
parent | 1a7113ba615baf78e3e17a8c949e5e2143b771f2 (diff) | |
download | vboot-a31ad0c3befcb93cc0e720c94919b203d5ff56ba.tar.gz |
futility: updater: fix wrong arguments passed by --ccd
When flashing using CCD, we should:
- Set programmer to raiden_debug_spi:target=AP
- Set write protection argument to "0" instead of number 0 (which means NULL).
- do_check_compatible_tpm_keys should not raise failure if force_update is set.
BRANCH=None
BUG=None
TEST=make runtest;
sudo futility update --ccd -i image.bin
Change-Id: I01121791bbbae0ffbcbc7a56c24b506d48ef7394
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1926011
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Auto-Submit: Hung-Te Lin <hungte@chromium.org>
-rw-r--r-- | futility/cmd_update.c | 4 | ||||
-rw-r--r-- | futility/updater.c | 7 | ||||
-rw-r--r-- | futility/updater.h | 4 |
3 files changed, 10 insertions, 5 deletions
diff --git a/futility/cmd_update.c b/futility/cmd_update.c index 89df6cbb..fef24c69 100644 --- a/futility/cmd_update.c +++ b/futility/cmd_update.c @@ -213,8 +213,8 @@ static int do_update(int argc, char *argv[]) case OPT_CCD: args.fast_update = 1; args.force_update = 1; - args.write_protection = 0; - args.programmer = "raiden_debug_spi"; + args.write_protection = "0"; + args.programmer = "raiden_debug_spi:target=AP"; break; case OPT_DUMMY: diff --git a/futility/updater.c b/futility/updater.c index 9f8ef52e..c5a20c51 100644 --- a/futility/updater.c +++ b/futility/updater.c @@ -1464,7 +1464,12 @@ static int do_check_compatible_tpm_keys(struct updater_config *cfg, /* The stored tpm_fwver can be 0 (b/116298359#comment3). */ tpm_fwver = get_system_property(SYS_PROP_TPM_FWVER, cfg); if (tpm_fwver < 0) { - ERROR("Invalid tpm_fwver: %d.\n", tpm_fwver); + /* + * tpm_fwver is commonly misreported in --ccd mode, so allow + * force_update to ignore the reported value. + */ + if (!cfg->force_update) + ERROR("Invalid tpm_fwver: %d.\n", tpm_fwver); return -1; } diff --git a/futility/updater.h b/futility/updater.h index 2f5603e2..ff2fc4f9 100644 --- a/futility/updater.h +++ b/futility/updater.h @@ -107,9 +107,9 @@ struct updater_config { struct updater_config_arguments { char *image, *ec_image, *pd_image; char *archive, *quirks, *mode; - const char *programmer; + const char *programmer, *write_protection; char *model, *signature_id; - char *emulation, *sys_props, *write_protection; + char *emulation, *sys_props; char *output_dir; char *repack, *unpack; int is_factory, try_update, force_update, do_manifest, host_only; |