blobs/download: exit if no board configs found

fixes ./build boot roms all

in detect_firmware(), "set" is used to get values from
configs, to know if things like ME/MRC are needed

on some "board" configs under resources/coreboot/, no
actual coreboot configs are provided, because they are
used as a reference (coreboot revision, tree name etc)
for actual boards, with actual coreboot configs

when attempting to build for such a board, running "set"
on such non-existent files would cause a non-zero exit,
when we want zero. the non-zero exit then caused the
build/boot/roms command to fail, when running "all" if
it found, for example, resources/coreboot/cros/ which
has the above problem, in this context

work around it by verifying that coreboot configs exist
for the given target name, in the blobutil download script.
if no such configs exist, then exit zero (success)

doing so is correct, because the script is intended to
do just that, erroring only if it is detected that blobs
are needed for a given board, but other errors occur; if
no coreboot configs exist, then no roms will be built and,
therefore, no blobs are needed

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe 2023-06-20 01:49:25 +01:00
parent 652f3ba379
commit 97c9f06c91
1 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,14 @@ main()
board="${1}"
boarddir="${cbcfgsdir}/${board}"
exit_if_no_config="exit 0"
for x in "${boarddir}"/config/*; do
if [ -f "${x}" ]; then
exit_if_no_config=""
fi
done
eval "${exit_if_no_config}"
if [ ! -d "${boarddir}" ]; then
fail "Target not defined"
elif [ ! -f "${boarddir}/board.cfg" ]; then