g:script to create cr50 release images

We are still building two images - for prod and dev fused H1 chips.
This requires different pairs of RO images and calls for using
different keys when signing RW images.

Each produced image is of 512K bytes in size, the ROs are paced at
offsets 0 and 0x40000, the RWs at offsets 0x4000 and 0x4000.

The signed ROs come from their respective source, their processing is
limited to converting into binary format and verifying that their key
signatures match image designation (prod vs dev).

The RWs binaries are derived from RW elf files which are the result of
running 'make BOARD=cr50'. The elves are converted into binary format
and signed, the bs script is used for that.

The bs script is modified to accept the destination file name from the
shell variable, to detect signing failures (resulting in zero sized
binaries), and to fix error reporting.

The new script create_released_image.sh expects exactly six command
line parameters:

  <prod RO A>.hex <prod RO B>.hex <dev RO A>.hex <dev RO B>.hex \
  <RW.elf> <RW_B.elf>

and generates two cr50 binary images.

The generated images are placed in the directory named cr50.r<ro
vers>.w<rw vers> (the versions are retrieved from the binaries using
usb_updater), and then placed in the tarball with the same base name.

This naming convention is imposed by the ebuild pulling in the tarball
from the binary component server (BCS).

On the successful completion the script prints out commands which can
be used to upload the new tarball to the BCS.

BRANCH=none
BUG=b:35587234
TEST=ran the script to generate the r0.0.10.w0.0.18 release, verified
     that all components of both imagea are properly signed (are
     bootable and the key signature matches the prod/dev convention).

Change-Id: I87be1d44a721c979bdeeabf986d717e3a382db45
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/439907
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Caveh Jalali <caveh@google.com>
2 files changed