diff options
author | Hung-Te Lin <hungte@chromium.org> | 2018-11-09 09:41:03 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-12-11 13:00:55 -0800 |
commit | 48d08d76c3cee2fb4ea3a7d965c64550d02f3bbd (patch) | |
tree | 6ef2c52f0340eb7afff703ebbb7cbe5c21028163 /futility | |
parent | 644bb1b079bed1c2ce370aa1a80a3e943ec78a56 (diff) | |
download | vboot-48d08d76c3cee2fb4ea3a7d965c64550d02f3bbd.tar.gz |
futility: updater: Add 'image.bin' as host image name in archive
The firmware updater archive is going to rename the prefix of host (AP)
firmware image from 'bios' to 'image' (CL:1318712), to be more
consistent with firmware package output. We need to include both old and
new names in updater manifest construction.
For --mode=output, we will produce both 'bios.bin' and 'image.bin'. In
future there should be only 'image.bin' after migration is completed.
BUG=b:65745723
TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility
BRANCH=None
Change-Id: I8b7e3bc2953b70525fb14fcf6aadaf6d1e00e4aa
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1327862
Diffstat (limited to 'futility')
-rw-r--r-- | futility/updater.c | 2 | ||||
-rw-r--r-- | futility/updater_archive.c | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/futility/updater.c b/futility/updater.c index dcd37bf6..fe488b0d 100644 --- a/futility/updater.c +++ b/futility/updater.c @@ -2055,7 +2055,9 @@ int updater_setup_config(struct updater_config *cfg, const char *r = arg->output_dir; if (!r) r = "."; + /* TODO(hungte) Remove bios.bin when migration is done. */ errorcnt += updater_output_image(&cfg->image, "bios.bin", r); + errorcnt += updater_output_image(&cfg->image, "image.bin", r); errorcnt += updater_output_image(&cfg->ec_image, "ec.bin", r); errorcnt += updater_output_image(&cfg->pd_image, "pd.bin", r); *do_update = 0; diff --git a/futility/updater_archive.c b/futility/updater_archive.c index 0a3ed502..e072de3f 100644 --- a/futility/updater_archive.c +++ b/futility/updater_archive.c @@ -31,7 +31,7 @@ * * A package for single board (i.e., not Unified Build) will have all the image * files in top folder: - * - host: 'bios.bin' + * - host: 'image.bin' (or 'bios.bin' as legacy name before CL:1318712) * - ec: 'ec.bin' * - pd: 'pd.bin' * If white label is supported, a 'keyset/' folder will be available, with key @@ -905,7 +905,8 @@ struct manifest *new_manifest_from_archive(struct archive *archive) { struct manifest manifest = {0}, *new_manifest; struct model_config model = {0}; - const char * const image_name = "bios.bin", + const char * const host_image_name = "image.bin", + * const old_host_image_name = "bios.bin", * const ec_name = "ec.bin", * const pd_name = "pd.bin"; @@ -913,10 +914,17 @@ struct manifest *new_manifest_from_archive(struct archive *archive) manifest.default_model = -1; archive_walk(archive, &manifest, manifest_scan_entries); if (manifest.num == 0) { + const char *image_name = NULL; struct firmware_image image = {0}; + /* Try to load from current folder. */ - if (!archive_has_entry(archive, image_name)) + if (archive_has_entry(archive, old_host_image_name)) + image_name = old_host_image_name; + else if (archive_has_entry(archive, host_image_name)) + image_name = host_image_name; + else return 0; + model.image = strdup(image_name); if (archive_has_entry(archive, ec_name)) model.ec_image = strdup(ec_name); |