update/blobs/extract: replace errant target code

check based on whether defconfigs are available, which
are used extensively, rather than checking based on
whether target.cfg is available, which is not used

Signed-off-by: Leah Rowe <leah@libreboot.org>
btrfsvols
Leah Rowe 2023-09-04 15:57:48 +01:00
parent ea7fae97bd
commit 52677309c5
1 changed files with 7 additions and 13 deletions

View File

@ -37,22 +37,12 @@ main()
vendor_rom="${2}"
boarddir="${cbcfgsdir}/${board}"
check_board
[ -f "${vendor_rom}" ] || \
err "${board}: file does not exist: ${vendor_rom}"
build_dependencies
extract_blobs
}
check_board()
{
if [ ! -f "${vendor_rom}" ]; then
err "check_board: ${board}: file does not exist: ${vendor_rom}"
elif [ ! -d "${boarddir}" ]; then
err "check_board: ${board}: target not defined"
elif [ ! -f "${boarddir}/target.cfg" ]; then
err "check_board: ${board}: missing target.cfg"
fi
}
build_dependencies()
{
if [ ! -d me_cleaner ]; then
@ -71,9 +61,13 @@ extract_blobs()
{
printf "extracting blobs for %s from %s\n" ${board} ${vendor_rom}
no_config="printf \"No configs on target, %s\\n\" ${board} 1>&2; exit 1"
for x in "${boarddir}"/config/*; do
[ -f "${x}" ] && no_config=""
done
eval "${no_config}"
set -- "${boarddir}/config/"*
. "${1}" 2>/dev/null
. "${boarddir}/target.cfg"
[ "$CONFIG_HAVE_MRC" != "y" ] || \
./update blobs mrc || err "extract_blobs: can't fetch mrc"