cros_bundle_firmware: Create U-Boot binary and binary with fdt
Make a copy of the U-Boot binary in the output directory, just for
convenience when looking at the results. Also create a binary which
is U-Boot plus an appended device tree.
BUG=chromium-os:19724
TEST=manual: run cros_bundle_firmware -O out
See that u-boot.bin and u-boot-dtb.bin are in the out directory.
Change-Id: Iaebdc58b785d66f8438afe6cd73b8f2e4f0182bc
Reviewed-on: https://gerrit.chromium.org/gerrit/18317
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index f559e27..defcd79 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -577,6 +577,17 @@
# Get all our blobs ready
pack.AddProperty('boot', self.uboot_fname)
+
+ # Make a copy of the fdt for the bootstub
+ fdt_data = self._tools.ReadFile(fdt.fname)
+ uboot_data = self._tools.ReadFile(self.uboot_fname)
+ uboot_copy = os.path.join(self._tools.outdir, 'u-boot.bin')
+ self._tools.WriteFile(uboot_copy, uboot_data)
+
+ bootstub = os.path.join(self._tools.outdir, 'u-boot-dtb.bin')
+ self._tools.WriteFile(bootstub, uboot_data + fdt_data)
+ pack.AddProperty('boot+dtb', bootstub)
+
pack.AddProperty('gbb', self.uboot_fname)
for blob_type in pack.GetBlobList(self.coreboot_fname is not None):
self._BuildBlob(pack, fdt, blob_type)