Always use the final 1MB of the coreboot image when building a bootstub.
This coincidentally works when building for x86 systems which have 8MB images
which have Coreboot in the final 1MB, and for ARM systems with 1MB images
where Coreboot occupies the whole thing. The final image will be 4MB, but the
image produced by Coreboot itself is 1MB.
This has all worked by coincidence before and will continue too with this
approach, only in more cases. A more robust mechanism should be found.
BUG=chrome-os-partner:17340
TEST=Built and booted depthcharge on Link.
BRANCH=None
Change-Id: Ia8aaf14cf2f4e56452c3d2e057ca6001758229db
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/43380
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index 1eceafd..6bdb40f 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -1101,7 +1101,7 @@
data = self._tools.ReadFile(bootstub)
bootstub_copy = os.path.join(self._tools.outdir, 'coreboot-8mb.rom')
self._tools.WriteFile(bootstub_copy, data)
- self._tools.WriteFile(bootstub, data[0x700000:])
+ self._tools.WriteFile(bootstub, data[-0x100000:])
image = os.path.join(self._tools.outdir, 'image.bin')
pack.PackImage(self._tools.outdir, image)