cros_bundle_firmware: Do not fail when using extracted BL2

To generate a flasher write_firmware takes the image apart, and then
modifies SPL to make it use the changed u-boot blob size. At this
point SPL blob is retrieved from the binary image, so its size is
likely to be larger than the actual blob. This poses a problem for
image verification, which expects the the value in the header size
field to exactly match the blob size.

To address this - allow blob size to exceed the size value in the blob
header.

BUG=chrome-os-partner:18447
TEST=manual

   . with u-boot/ebuild modifications enabling variable size SPL ran
     the following commands

   $ emerge-peach_pit chromeos-bootimage chromeos-u-boot exynos-pre-boot
   $ sudo cros_write_firmware -b peach -w sd:. -M exynos --board peach \
      -i /build/peach_pit/firmware/image-peach_pit.bin \
      --dt /tmp/u-peach/dts/exynos5420-peach_pit.dtb -F spi \
      -U /build/peach_pit/firmware/u-boot.bin

     observed the generated SD card flash the onboard SPI flash on
     peach_pit, and then observed the peach_pit boot from SPI flash
     after reset

   . unittests still pass

   $ FEATURES=test sudo -E emerge cros-devutils

Change-Id: Ie32343409d1c2d2cf0ba8e78dd078ee278b4995f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58226
Reviewed-by: Simon Glass <sjg@chromium.org>
2 files changed