summaryrefslogtreecommitdiff
path: root/futility
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2021-11-23 13:09:41 -0800
committerCommit Bot <commit-bot@chromium.org>2021-12-14 19:43:52 +0000
commit6c73a1b7c6ddc68c98092036057dad7188ee89c8 (patch)
treee3e5e7311b302a4803ee35164cde7a9c62da4422 /futility
parent8028cac33c9c408f90de9ceffc714a1a0ca9d583 (diff)
downloadvboot-6c73a1b7c6ddc68c98092036057dad7188ee89c8.tar.gz
futility/update: Search RO CBFS files in "COREBOOT", not "RO_SECTION"
The "RO_SECTION" FMAP area is a parent area that contains multiple nested areas, including the "COREBOOT" area containing the actual RO CBFS. On some platforms the "COREBOOT" area may be the first area in "RO_SECTION", and therefore the start offsets would be equal and `cbfstool -r RO_SECTION` would accidentally do the right thing -- but this is not true for all platforms and may break elsewhere. I don't know what this code does or how to test it but I assume fixing this issue is a good thing. BRANCH=None BUG=None TEST=None Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: Ica281af75299e06c36e2f0437d2b1fcc6c0731e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3299058 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'futility')
-rw-r--r--futility/updater.h1
-rw-r--r--futility/updater_quirks.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/futility/updater.h b/futility/updater.h
index 69ba5e2d..856ea781 100644
--- a/futility/updater.h
+++ b/futility/updater.h
@@ -14,6 +14,7 @@
/* FMAP section names. */
static const char * const FMAP_RO_FRID = "RO_FRID",
* const FMAP_RO_SECTION = "RO_SECTION",
+ * const FMAP_RO_CBFS = "COREBOOT",
* const FMAP_RO_GBB = "GBB",
* const FMAP_RW_VBLOCK_A = "VBLOCK_A",
* const FMAP_RW_VBLOCK_B = "VBLOCK_B",
diff --git a/futility/updater_quirks.c b/futility/updater_quirks.c
index 1d1ba62a..e5ee5c1b 100644
--- a/futility/updater_quirks.c
+++ b/futility/updater_quirks.c
@@ -116,10 +116,10 @@ static int ec_ro_software_sync(struct updater_config *cfg)
ERROR("EC image has invalid section '%s'.\n", "EC_RO");
return 1;
}
- ec_ro_path = cbfs_extract_file(tmp_path, FMAP_RO_SECTION, "ecro",
+ ec_ro_path = cbfs_extract_file(tmp_path, FMAP_RO_CBFS, "ecro",
&cfg->tempfiles);
if (!ec_ro_path ||
- !cbfs_file_exists(tmp_path, FMAP_RO_SECTION, "ecro.hash")) {
+ !cbfs_file_exists(tmp_path, FMAP_RO_CBFS, "ecro.hash")) {
INFO("No valid EC RO for software sync in AP firmware.\n");
return 1;
}