summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--futility/updater.c2
-rw-r--r--futility/updater_archive.c14
-rw-r--r--tests/futility/link_bios.manifest.json (renamed from tests/futility/link.manifest.json)0
-rw-r--r--tests/futility/link_image.manifest.json7
-rwxr-xr-xtests/futility/test_update.sh38
5 files changed, 42 insertions, 19 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);
diff --git a/tests/futility/link.manifest.json b/tests/futility/link_bios.manifest.json
index 9bd33f52..9bd33f52 100644
--- a/tests/futility/link.manifest.json
+++ b/tests/futility/link_bios.manifest.json
diff --git a/tests/futility/link_image.manifest.json b/tests/futility/link_image.manifest.json
new file mode 100644
index 00000000..e3296a0e
--- /dev/null
+++ b/tests/futility/link_image.manifest.json
@@ -0,0 +1,7 @@
+{
+ "link": {
+ "host": { "versions": { "ro": "Google_Link.2695.1.133", "rw": "Google_Link.2695.1.133" },
+ "keys": { "root": "7b5c520ceabce86f13e02b7ca363cfb509fc5b98", "recovery": "7e74cd6d66f361da068c0419d2e0946b4d091e1c" },
+ "image": "image.bin" }
+ }
+}
diff --git a/tests/futility/test_update.sh b/tests/futility/test_update.sh
index 03743f97..54f2723d 100755
--- a/tests/futility/test_update.sh
+++ b/tests/futility/test_update.sh
@@ -306,11 +306,17 @@ echo 'echo "${WL_TAG}"' >"${A}/bin/vpd"
chmod +x "${A}/bin/vpd"
cp -f "${LINK_BIOS}" "${A}/bios.bin"
-echo "TEST: Manifest (--manifest)"
+echo "TEST: Manifest (--manifest, bios.bin)"
${FUTILITY} update -a "${A}" --manifest >"${TMP}.json.out"
-cmp "${TMP}.json.out" "${SCRIPTDIR}/link.manifest.json"
+cmp "${TMP}.json.out" "${SCRIPTDIR}/link_bios.manifest.json"
-cp -f "${TO_IMAGE}" "${A}/bios.bin"
+mv -f "${A}/bios.bin" "${A}/image.bin"
+echo "TEST: Manifest (--manifest, image.bin)"
+${FUTILITY} update -a "${A}" --manifest >"${TMP}.json.out"
+cmp "${TMP}.json.out" "${SCRIPTDIR}/link_image.manifest.json"
+
+
+cp -f "${TO_IMAGE}" "${A}/image.bin"
test_update "Full update (--archive, single package)" \
"${FROM_IMAGE}" "${TMP}.expected.full" \
-a "${A}" --wp=0 --sys_props 0,0x10001,1,3
@@ -318,50 +324,50 @@ test_update "Full update (--archive, single package)" \
echo "TEST: Output (--mode=output)"
mkdir -p "${TMP}.output"
${FUTILITY} update -i "${LINK_BIOS}" --mode=output --output_dir="${TMP}.output"
-cmp "${LINK_BIOS}" "${TMP}.output/bios.bin"
+cmp "${LINK_BIOS}" "${TMP}.output/image.bin"
mkdir -p "${A}/keyset"
-cp -f "${LINK_BIOS}" "${A}/bios.bin"
+cp -f "${LINK_BIOS}" "${A}/image.bin"
cp -f "${TMP}.to/rootkey" "${A}/keyset/rootkey.WL"
cp -f "${TMP}.to/VBLOCK_A" "${A}/keyset/vblock_A.WL"
cp -f "${TMP}.to/VBLOCK_B" "${A}/keyset/vblock_B.WL"
-${FUTILITY} gbb -s --rootkey="${TMP}.from/rootkey" "${A}/bios.bin"
-${FUTILITY} load_fmap "${A}/bios.bin" VBLOCK_A:"${TMP}.from/VBLOCK_A"
-${FUTILITY} load_fmap "${A}/bios.bin" VBLOCK_B:"${TMP}.from/VBLOCK_B"
+${FUTILITY} gbb -s --rootkey="${TMP}.from/rootkey" "${A}/image.bin"
+${FUTILITY} load_fmap "${A}/image.bin" VBLOCK_A:"${TMP}.from/VBLOCK_A"
+${FUTILITY} load_fmap "${A}/image.bin" VBLOCK_B:"${TMP}.from/VBLOCK_B"
test_update "Full update (--archive, whitelabel, no VPD)" \
- "${A}/bios.bin" "!Need VPD set for white" \
+ "${A}/image.bin" "!Need VPD set for white" \
-a "${A}" --wp=0 --sys_props 0,0x10001,1,3
test_update "Full update (--archive, whitelabel, no VPD - factory mode)" \
- "${LINK_BIOS}" "${A}/bios.bin" \
+ "${LINK_BIOS}" "${A}/image.bin" \
-a "${A}" --wp=0 --sys_props 0,0x10001,1,3 --mode=factory
test_update "Full update (--archive, whitelabel, no VPD - quirk mode)" \
- "${LINK_BIOS}" "${A}/bios.bin" \
+ "${LINK_BIOS}" "${A}/image.bin" \
-a "${A}" --wp=0 --sys_props 0,0x10001,1,3 --quirks=allow_empty_wltag
test_update "Full update (--archive, WL, single package)" \
- "${A}/bios.bin" "${LINK_BIOS}" \
+ "${A}/image.bin" "${LINK_BIOS}" \
-a "${A}" --wp=0 --sys_props 0,0x10001,1,3 --signature_id=WL
WL_TAG="WL" PATH="${A}/bin:${PATH}" \
test_update "Full update (--archive, WL, fake vpd)" \
- "${A}/bios.bin" "${LINK_BIOS}" \
+ "${A}/image.bin" "${LINK_BIOS}" \
-a "${A}" --wp=0 --sys_props 0,0x10001,1,3
echo "TEST: Output (-a, --mode=output)"
mkdir -p "${TMP}.outa"
-cp -f "${A}/bios.bin" "${TMP}.emu"
+cp -f "${A}/image.bin" "${TMP}.emu"
WL_TAG="WL" PATH="${A}/bin:${PATH}" \
${FUTILITY} update -a "${A}" --mode=output --emu="${TMP}.emu" \
--output_dir="${TMP}.outa"
-cmp "${LINK_BIOS}" "${TMP}.outa/bios.bin"
+cmp "${LINK_BIOS}" "${TMP}.outa/image.bin"
# Test archive with Unified Build contents.
cp -r "${SCRIPTDIR}/models" "${A}/"
mkdir -p "${A}/images"
-mv "${A}/bios.bin" "${A}/images/bios_coral.bin"
+mv "${A}/image.bin" "${A}/images/bios_coral.bin"
cp -f "${PEPPY_BIOS}" "${A}/images/bios_peppy.bin"
cp -f "${LINK_BIOS}" "${A}/images/bios_link.bin"
cp -f "${TMP}.to/rootkey" "${A}/keyset/rootkey.whitetip-wl"