vendor.sh: minor code cleanup

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit6
Leah Rowe 2024-06-20 01:23:37 +01:00
parent 808458ced5
commit bc61c39ec8
1 changed files with 6 additions and 7 deletions

View File

@ -35,14 +35,13 @@ vendor_download()
boarddir="$cbcfgsdir/$board" boarddir="$cbcfgsdir/$board"
_b="${board%%_*mb}" # shorthand (no duplication per rom size) _b="${board%%_*mb}" # shorthand (no duplication per rom size)
detect_firmware && exit 0 getcfg && scancfg "$_b" "config/vendor" && bootstrap && getfiles
scan_config "$_b" "config/vendor" && bootstrap && getfiles
} }
detect_firmware() getcfg()
{ {
[ -d "$boarddir" ] || $err "Target '$board' not defined." [ -d "$boarddir" ] || $err "Target '$board' not defined."
check_defconfig "$boarddir" 1>"$tmpdir/vendorcfg.list" && return 0 check_defconfig "$boarddir" 1>"$tmpdir/vendorcfg.list" && return 1
while read -r cbcfgfile; do while read -r cbcfgfile; do
set +u +e set +u +e
. "$cbcfgfile" 2>/dev/null . "$cbcfgfile" 2>/dev/null
@ -50,7 +49,7 @@ detect_firmware()
done < "$tmpdir/vendorcfg.list" done < "$tmpdir/vendorcfg.list"
. "$boarddir/target.cfg" 2>/dev/null . "$boarddir/target.cfg" 2>/dev/null
[ -z "$tree" ] && $err "detect_firmware $boarddir: tree undefined" [ -z "$tree" ] && $err "getcfg $boarddir: tree undefined"
cbdir="src/coreboot/$tree" cbdir="src/coreboot/$tree"
cbfstool="elf/cbfstool/$tree/cbfstool" cbfstool="elf/cbfstool/$tree/cbfstool"
@ -60,9 +59,9 @@ detect_firmware()
for c in CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN CONFIG_KBC1126_FIRMWARE \ for c in CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN CONFIG_KBC1126_FIRMWARE \
CONFIG_VGA_BIOS_FILE CONFIG_INCLUDE_SMSC_SCH5545_EC_FW; do CONFIG_VGA_BIOS_FILE CONFIG_INCLUDE_SMSC_SCH5545_EC_FW; do
eval "[ \"\${$c}\" = \"/dev/null\" ] && continue" eval "[ \"\${$c}\" = \"/dev/null\" ] && continue"
eval "[ -z \"\${$c}\" ] || return 1" eval "[ -z \"\${$c}\" ] || return 0"
done done
printf "Vendor files not needed for: %s\n" "$board" 1>&2 printf "Vendor files not needed for: %s\n" "$board" 1>&2 && return 1
} }
bootstrap() bootstrap()