futility: cmd_update: Process FMAP and parse image version

Add `find_firmware_section` and `firmware_section_exists` utility
functions to manipulate FMAP based sections easily. It is used by
parsing of image version strings, which helps indicating the firmware
versions going to be updated.

BUG=chromium:875551
TEST=make futil; futility update -i /build/eve/firmware/image.bin
     tests/futility/run_test_scripts.sh $(pwd)/build/futility
BRANCH=None

Change-Id: I458fa8c31c45dbbd29614c3d6ccd586e46a3ed0b
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1183649
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2 files changed