cbf: restore ability to bundle 'small' images

Passing parameter '-s' to cros_bundle_firmware causes it to try to add
to the image all flashmap sections, even those which are not marked

This causes a failure, because the list of sections allowed in the
image is limited to those which are marked required. This change makes
sure that sections which are not required are not attempted to be
added to the final image.

   . reemerged cros-devutils package

   . ran emerge-daisy chromeos-u-boot chromeos-bootimage, observed a
     4M binary images created as expected.

   . ran cros_bundle_firmware manually, passing it '-s' as one of the

     It was failing before this change, and succeeded now. The image
     is created is 700K in size, the reason being that the recovery
     u=boot is marked as required in the flash map. This will be fixed

   . attempts to run portage unittests failed due to unrelated tests
     being broken.

Change-Id: I515994290a806ab9a3cb4134d0776463addd8eea
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169451
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/host/lib/pack_firmware.py b/host/lib/pack_firmware.py
index 0ec551c..8d0f124 100644
--- a/host/lib/pack_firmware.py
+++ b/host/lib/pack_firmware.py
@@ -796,7 +796,7 @@
     for _ in range(0, 2):
       for entry in self.entries:
-        if isinstance(entry, EntryBlob):
+        if isinstance(entry, EntryBlob) and entry.required:
           self._out.Info("Updating blob positions in fdt for '%s'" % entry.key)
           data, directory = self.ConcatPropContents(
               entry.key.split(','), None, entry.with_index)