cros_bundle_firmware fix for complete coreboot images
coreboot builds images with ME firmware now. Fix cros_bundle_firmware
to cope with that.
Previously the coreboot ebuild had to provide a skeleton binary that
contained the Intel Firmware Descriptor and ME firmware, plus a binary
containing coreboot. Now there is only one binary that is used.
In order to provide a minimally intrusive change, use the new coreboot
binary as skeleton file, and carve out the coreboot portion from the
skeleton, after making all changes (like adding a payload etc) to the
full ("skeleton") image.
CQ-DEPEND=CL:*23708 CL:*23709 CL:*25948
CQ-DEPEND=CL:*25952 CL:*25953 CL:*25954
CQ-DEPEND=CL:*25955 CL:*25956 CL:*25957
CQ-DEPEND=CL:30616
BUG=none
TEST=emerge-link chromeos-coreboot-link chromeos-bootimage
flash resulting image to Link, observe that it is still booting.
BRANCH=none
Change-Id: Idbd8dca54f6c50150f3bca1cabf7e5e3eb760c71
Reviewed-on: https://gerrit.chromium.org/gerrit/34487
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Ready: Stefan Reinauer <reinauer@chromium.org>
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index b8203df..d94f506 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -202,7 +202,7 @@
if not self.coreboot_fname:
self.coreboot_fname = os.path.join(build_root, 'coreboot.rom')
if not self.skeleton_fname:
- self.skeleton_fname = os.path.join(build_root, 'skeleton.bin')
+ self.skeleton_fname = os.path.join(build_root, 'coreboot.rom')
if not self.ecrw_fname:
self.ecrw_fname = os.path.join(build_root, 'ec.RW.bin')
if not self.ecro_fname:
@@ -884,6 +884,10 @@
fdt = fdt.Copy(os.path.join(self._tools.outdir, 'bootstub.dtb'))
self._tools.Run('cbfstool', [bootstub, 'add', fdt.fname, 'u-boot.dtb',
'0xac'])
+ bootstub_tmp = bootstub + '.tmp'
+ self._tools.Run('dd', ['if=' + bootstub, 'of=' + bootstub_tmp,
+ 'bs=1M', 'skip=7'])
+ shutil.move(bootstub_tmp, bootstub)
image = os.path.join(self._tools.outdir, 'image.bin')
pack.PackImage(self._tools.outdir, image)