sign_official_build: Fix Guybrush board detection for RO_GSCVD bypass

Guybrush AP firmware contains an uninitialized RO_GSCVD section in its
FMAP (b/263378945). Currently, sign_official_build.sh checks whether the
Guybrush board exists via `[[ -e "${shellball_dir}/models/guybrush" ]]`.
However, CL:5826250 deprecated setvars.sh and removed the models/
directory from shellballs, causing this check to always evaluate to
false.

Previously, this went unnoticed because futility gscvd failures were
silently ignored due to `resign_firmware_shellball ... || ret=$?`
suppressing `set -e` inside the function. When CL:8276431 added `|| die`
to sign_gscvd() and CL:8276432 propagated worker exit codes, Guybrush
release signing failed (b/557267321).

Restore the board check by retrieving board_name via
get_boardvar_from_lsb_release() in resign_firmware_payload() and
passing it down to resign_firmware_image(). resign_firmware_image()
determines whether to bypass RO_GSCVD for guybrush before calling
sign_gscvd().

BUG=b:557267321
TEST=make runtests
TEST=Manual test with sign_official_build.sh shellball verifying
     RO_GSCVD bypass for Guybrush and failure for non-Guybrush boards
BRANCH=none
TAG=agy
CONV=705e5b3f-acf0-4ebd-91be-9a3d57b9198a

Change-Id: I7a6707800aa9ffa37448cff54287a5026a6a6964
Signed-off-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/8365105
Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Yu-Ping Wu <yupingso@chromium.org>
1 file changed