utility/dev_debug_vboot: Make firmware version lookup ~400x cheaper On a 4 GB nissa device, this makes a lookup that runs after every boot about 400x cheaper: from ~74 s of busy work and ~460 MB of disk reads down to 0.17 s, with identical results. Why: about a minute after boot, `dev_debug_vboot --cleanup` asks `chromeos-firmwareupdate --manifest` for the expected firmware version, used only for the Platform.Firmware.Mismatch UMA metric. Without --fast, this unpacks every firmware image in the updater (457 MB, 249 models on nissa) to rebuild a version list from scratch. That same list is already saved inside the updater as manifest.json, generated when the updater is built or re-signed. --fast simply reads it. The updater ships on the read-only rootfs, so the saved list always matches the bundled images and only changes with an OS update. Nothing else changes. If the read fails, the script already logs an error and skips the metric, as before. BUG=b:441643151 BRANCH=none TEST=CQ+manual verification Change-Id: I510100a8f07765525d10238878fdd1f33e4686f2 Signed-off-by: Di Wu <diwux@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/8594880 Commit-Queue: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
diff --git a/utility/dev_debug_vboot b/utility/dev_debug_vboot index af007ed..8ca23a6 100755 --- a/utility/dev_debug_vboot +++ b/utility/dev_debug_vboot
@@ -172,7 +172,7 @@ local cros_fwid="$(crossystem fwid 2>/dev/null)" local model="$(cros_config / name || echo unknown)" - local manifest="$(chromeos-firmwareupdate --manifest 2>/dev/null)" + local manifest="$(chromeos-firmwareupdate --manifest --fast 2>/dev/null)" local expect_fwid=$(echo "${manifest}" | jq -c -r ".${model}.host.versions.rw" 2>/dev/null)