summaryrefslogtreecommitdiff
path: root/futility/updater_quirks.c
diff options
context:
space:
mode:
Diffstat (limited to 'futility/updater_quirks.c')
-rw-r--r--futility/updater_quirks.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/futility/updater_quirks.c b/futility/updater_quirks.c
index 49b35caa..47ec08df 100644
--- a/futility/updater_quirks.c
+++ b/futility/updater_quirks.c
@@ -205,30 +205,7 @@ static int quirk_enlarge_image(struct updater_config *cfg)
*/
static int quirk_unlock_me_for_update(struct updater_config *cfg)
{
- struct firmware_section section;
- struct firmware_image *image_to = &cfg->image;
- const int flash_master_offset = 128;
- const uint8_t flash_master[] = {
- 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff,
- 0xff, 0xff
- };
-
- find_firmware_section(&section, image_to, FMAP_SI_DESC);
- if (section.size < flash_master_offset + ARRAY_SIZE(flash_master))
- return 0;
- if (memcmp(section.data + flash_master_offset, flash_master,
- ARRAY_SIZE(flash_master)) == 0) {
- VB2_DEBUG("Target ME not locked.\n");
- return 0;
- }
- /*
- * b/35568719: We should only update with unlocked ME and let
- * board-postinst lock it.
- */
- INFO("Changed Flash Master Values to unlocked.\n");
- memcpy(section.data + flash_master_offset, flash_master,
- ARRAY_SIZE(flash_master));
- return 0;
+ return unlock_flash_master(&cfg->image);
}
/*
@@ -236,6 +213,10 @@ static int quirk_unlock_me_for_update(struct updater_config *cfg)
* so the system has a chance to make sure SI_ME won't be corrupted on next boot
* before locking the Flash Master values in SI_DESC.
* Returns 0 on success, otherwise failure.
+ *
+ * TODO(b/270275115): Reuse the common unlock_flash_master() function and apply
+ * the Wilco-specific changes on top (or drop them if the common settings work
+ * for Wilco too).
*/
static int quirk_unlock_wilco_me_for_update(struct updater_config *cfg)
{