diff options
author | Hung-Te Lin <hungte@chromium.org> | 2023-02-09 20:48:10 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-02-12 10:37:43 +0000 |
commit | fd2a71c8378de63a728d4cca949622dfbcbb0931 (patch) | |
tree | a1e477cdd33f174cc3b942d9c259265d69d33864 /futility | |
parent | 04a92c59a3c62100846b74e64def618b4d1ed20e (diff) | |
download | vboot-fd2a71c8378de63a728d4cca949622dfbcbb0931.tar.gz |
futility: updater: drop vboot1 support
As CL:4211436 mentioned, all vboot1 boards are now AUE and it is time to
drop vboot1 logic to simplify the updater.
BUG=b:124141368,b:172342538
TEST=make; run test
BRANCH=None
Change-Id: Ice445158abd2b6465dad7cade10ce88b46d3c981
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4235302
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'futility')
-rw-r--r-- | futility/updater.c | 44 | ||||
-rw-r--r-- | futility/updater_dut.c | 7 | ||||
-rw-r--r-- | futility/updater_utils.h | 1 |
3 files changed, 15 insertions, 37 deletions
diff --git a/futility/updater.c b/futility/updater.c index 96004713..6515402b 100644 --- a/futility/updater.c +++ b/futility/updater.c @@ -223,16 +223,11 @@ static int section_is_filled_with(const struct firmware_section *section, * Returns the section name if success, otherwise NULL. */ static const char *decide_rw_target(struct updater_config *cfg, - enum target_type target, - int is_vboot2) + enum target_type target) { const char *a = FMAP_RW_SECTION_A, *b = FMAP_RW_SECTION_B; int slot = dut_get_property(DUT_PROP_MAINFW_ACT, cfg); - /* In vboot1, always update B and check content with A. */ - if (!is_vboot2) - return target == TARGET_UPDATE ? b : a; - switch (slot) { case SLOT_A: return target == TARGET_UPDATE ? b : a; @@ -251,7 +246,7 @@ static const char *decide_rw_target(struct updater_config *cfg, * Returns 0 if success, non-zero if error. */ static int set_try_cookies(struct updater_config *cfg, const char *target, - int has_update, int is_vboot2) + int has_update) { int tries = 8; const char *slot; @@ -279,19 +274,16 @@ static int set_try_cookies(struct updater_config *cfg, const char *target, return 0; } - if (is_vboot2) { - if (dut_set_property_string("fw_try_next", slot)) { - ERROR("Failed to set fw_try_next to %s.\n", slot); - return -1; - } - if (!has_update && - dut_set_property_string("fw_result", "success")) { - ERROR("Failed to set fw_result to success.\n"); - return -1; - } + if (dut_set_property_string("fw_try_next", slot)) { + ERROR("Failed to set fw_try_next to %s.\n", slot); + return -1; + } + if (!has_update && + dut_set_property_string("fw_result", "success")) { + ERROR("Failed to set fw_result to success.\n"); + return -1; } - /* fw_try_count is identical to fwb_tries in vboot1. */ if (dut_set_property_int("fw_try_count", tries)) { ERROR("Failed to set fw_try_count to %d.\n", tries); return -1; @@ -908,7 +900,6 @@ static enum updater_error_codes update_try_rw_firmware( { const char *target, *self_target; int has_update = 1; - int is_vboot2 = dut_get_property(DUT_PROP_FW_VBOOT2, cfg); preserve_gbb(image_from, image_to, 1, 0, 0); if (!wp_enabled && section_needs_update( @@ -921,8 +912,7 @@ static enum updater_error_codes update_try_rw_firmware( if (check_compatible_tpm_keys(cfg, image_to)) return UPDATE_ERR_TPM_ROLLBACK; - VB2_DEBUG("Firmware %s vboot2.\n", is_vboot2 ? "is" : "is NOT"); - self_target = target = decide_rw_target(cfg, TARGET_SELF, is_vboot2); + self_target = target = decide_rw_target(cfg, TARGET_SELF); if (target == NULL) { ERROR("TRY-RW update needs system to boot in RW firmware.\n"); return UPDATE_ERR_TARGET; @@ -938,7 +928,7 @@ static enum updater_error_codes update_try_rw_firmware( has_update = section_needs_update(image_from, image_to, target); if (has_update) { - target = decide_rw_target(cfg, TARGET_UPDATE, is_vboot2); + target = decide_rw_target(cfg, TARGET_UPDATE); STATUS("TRY-RW UPDATE: Updating %s to try on reboot.\n", target); @@ -965,7 +955,7 @@ static enum updater_error_codes update_try_rw_firmware( } /* Always set right cookies for next boot. */ - if (set_try_cookies(cfg, target, has_update, is_vboot2)) + if (set_try_cookies(cfg, target, has_update)) return UPDATE_ERR_SET_COOKIES; /* Do not fail on updating legacy. */ @@ -1126,12 +1116,8 @@ enum updater_error_codes update_firmware(struct updater_config *cfg) if (cfg->try_update == TRY_UPDATE_DEFERRED_APPLY) { INFO("Apply deferred updates, only setting cookies for the " "next boot slot.\n"); - int vboot2 = dut_get_property(DUT_PROP_FW_VBOOT2, cfg); - if (set_try_cookies( - cfg, - decide_rw_target(cfg, TARGET_UPDATE, vboot2), - /*has_update=*/1, - vboot2)) + if (set_try_cookies(cfg, decide_rw_target(cfg, TARGET_UPDATE), + /*has_update=*/1)) return UPDATE_ERR_SET_COOKIES; return UPDATE_ERR_DONE; } diff --git a/futility/updater_dut.c b/futility/updater_dut.c index 8789f89b..f152a45e 100644 --- a/futility/updater_dut.c +++ b/futility/updater_dut.c @@ -85,12 +85,6 @@ static int dut_get_wp_hw(struct updater_config *cfg) return dut_get_property_int("wpsw_cur") ? WP_ENABLED : WP_DISABLED; } -/* A helper function to return "fw_vboot2" system property. */ -static int dut_get_fw_vboot2(struct updater_config *cfg) -{ - return dut_get_property_int("fw_vboot2"); -} - static int dut_get_platform_version(struct updater_config *cfg) { return dut_get_property_int("board_id"); @@ -131,7 +125,6 @@ void dut_init_properties(struct dut_property *props, int num) assert(num >= DUT_PROP_MAX); props[DUT_PROP_MAINFW_ACT].getter = dut_get_mainfw_act; props[DUT_PROP_TPM_FWVER].getter = dut_get_tpm_fwver; - props[DUT_PROP_FW_VBOOT2].getter = dut_get_fw_vboot2; props[DUT_PROP_PLATFORM_VER].getter = dut_get_platform_version; props[DUT_PROP_WP_HW].getter = dut_get_wp_hw; props[DUT_PROP_WP_SW].getter = dut_get_wp_sw; diff --git a/futility/updater_utils.h b/futility/updater_utils.h index 93964a4d..bdb0c49b 100644 --- a/futility/updater_utils.h +++ b/futility/updater_utils.h @@ -239,7 +239,6 @@ struct dut_property { enum dut_property_type { DUT_PROP_MAINFW_ACT, DUT_PROP_TPM_FWVER, - DUT_PROP_FW_VBOOT2, DUT_PROP_PLATFORM_VER, DUT_PROP_WP_HW, DUT_PROP_WP_SW, |