cros_bundle_firmware: Pass PackFirmware properties back from bundle

Some of the properties created by PackFirmware are useful later when
writing firmware to a device. Return these from BundleFirmware's Start()
method.

BUG=chrome-os-partner:10075
TEST=emerge-tegra2_seaboard chromeos-bootimage

Change-Id: Ic23a3c20e392e4d6ce7c1dfb118e95a660e343bc
Reviewed-on: https://gerrit.chromium.org/gerrit/24762
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
diff --git a/host/cros_bundle_firmware b/host/cros_bundle_firmware
index 8d747c8..c335b99 100755
--- a/host/cros_bundle_firmware
+++ b/host/cros_bundle_firmware
@@ -91,7 +91,7 @@
     bundle.AddEnableList(options.add_node_enable)
     bundle.spl_source = options.spl_source
 
-    out_fname = bundle.Start(options.hardware_id, options.output,
+    out_fname, props = bundle.Start(options.hardware_id, options.output,
         options.show_map)
 
     # Write it to the board if required.
@@ -103,7 +103,7 @@
       file_list = bundle.GetFiles()
       write_firmware.DoWriteFirmware(output, tools, fdt, flasher,
           file_list, out_fname, bundle, text_base, dest=options.write,
-          flash_dest=options.flash_dest)
+          flash_dest=options.flash_dest, props=props)
 
   except (CmdError, ValueError) as err:
     # For verbosity 4 we want to display all possible information
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index 1184b28..db93cd5 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -816,4 +816,4 @@
     if output_fname:
       shutil.copyfile(image, output_fname)
       self._out.Notice("Output image '%s'" % output_fname)
-    return image
+    return image, pack.props
diff --git a/host/lib/write_firmware.py b/host/lib/write_firmware.py
index d27a7e2..d106961 100644
--- a/host/lib/write_firmware.py
+++ b/host/lib/write_firmware.py
@@ -571,7 +571,7 @@
 
 def DoWriteFirmware(output, tools, fdt, flasher, file_list, image_fname,
                     bundle, text_base=None, update=True, verify=False,
-                    dest=None, flash_dest=None):
+                    dest=None, flash_dest=None, props=None):
   """A simple function to write firmware to a device.
 
   This creates a WriteFirmware object and uses it to write the firmware image
@@ -590,6 +590,7 @@
     verify: Verify the write by doing a readback and CRC.
     dest: Destination device to write firmware to (usb, sd).
     flash_dest: Destination device for flasher to program payload into.
+    props: A dictionary containing properties from the PackFirmware object
   """
   write = WriteFirmware(tools, fdt, output, bundle)
   if text_base: