new_variant: add support for reference board name

A baseboard can have a reference board whose name differs from the
project name, e.g. Zork has the Trembyle reference board.
All of the cros_workon and emerge commands, plus the usage in the
commit messages are 'zork' but the coreboot config file to use is
config.trembyle, not config.zork. Add the reference board as a
variable in the modules we load for supported boards, and as a
parameter to create_coreboot_config.sh.

Add a new step for copying the coreboot config from third_party
to overlays, which is required only for Zork at this time.

Add -j to create_initial_ec_image.sh so that the test build
is a lot faster.

BUG=b:148161697
TEST=Call create_coreboot_config.sh directly and verify that
it creates the correct config files.

$ create_coreboot_config.sh zork trembyle frobozz
$ diff config.trembyle config.frobozz
5c5
< CONFIG_BOARD_GOOGLE_TREMBYLE=y
---
> CONFIG_BOARD_GOOGLE_FROBOZZ=y

$ create_coreboot_config.sh hatch hatch sushi
$ diff config.hatch config.sushi
2c2
< CONFIG_BOARD_GOOGLE_HATCH=y
---
> CONFIG_BOARD_GOOGLE_SUSHI=y
19c19
< CONFIG_IFD_BIN_PATH="3rdparty/blobs/baseboard/hatch/descriptor-hatch.bin"
---
> CONFIG_IFD_BIN_PATH="3rdparty/blobs/baseboard/hatch/descriptor-sushi.bin"
39c39
< CONFIG_ME_BIN_PATH="3rdparty/blobs/baseboard/hatch/me-hatch.bin"
---
> CONFIG_ME_BIN_PATH="3rdparty/blobs/baseboard/hatch/me-sushi.bin"

Run the new_variant program to test creating a variant of hatch and a
variant of zork:

$ new_variant.py --board=hatch --variant=sushi

Verify that the CL in
third_party/chromiumos-overlay/sys-boot/coreboot/files/configs
is correct for the sushi variant of hatch

$ new_variant.py --board=trembyle --variant=frobozz

It will fail with an error because coreboot support isn't present yet.
Edit ~/.new_variant.yaml and change "step" to "cb_config".
Run new_variant.py --continue

Verify that the CL in
third_party/chromiumos-overlay/sys-boot/coreboot/files/configs
is correct for the frobozz variant of trembyle, but the commit messages
refer to zork in the title and the TEST= line, and the reference board
in the text.

Change-Id: I65a96b31dd52b3e5b9ddd240f53c215b19d2b84e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2016085
Tested-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Martin Roth <martinroth@google.com>
8 files changed