Add a utility function to get firmware binary version.

The function utilizes dump_fmap to extract RO_FRID section of a given
firmware binary to get its version. Note that this only works on CrOS
devices or inside a CrOS SDK chroot.

Also update finalize_bundle to use the new function to get BIOS and EC
firmware versions.

TEST=manually run finalize_bundle and verify that it dumps correct
version strings

Change-Id: If09297fd5fef439fc1168b7dd583a530ffebb894
Reviewed-by: Ricky Liang <>
Commit-Queue: Ricky Liang <>
Tested-by: Ricky Liang <>
2 files changed