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.

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

Change-Id: If09297fd5fef439fc1168b7dd583a530ffebb894
Reviewed-on: https://chromium-review.googlesource.com/202909
Reviewed-by: Ricky Liang <jcliang@chromium.org>
Commit-Queue: Ricky Liang <jcliang@chromium.org>
Tested-by: Ricky Liang <jcliang@chromium.org>
2 files changed