vendor.sh: split up setvfile()

split the actual bootstrapping to getvfile()

setvfile only sets the config, but then it will
call getvfile() to act on that config.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-11 00:34:53 +01:00
parent 7d90d43425
commit 0cc816167b
2 changed files with 17 additions and 15 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ readkconfig()
x_ rm -f "$xbmktmp/cbcfg"
fx_ scankconfig x_ find "$boarddir/config" -type f
eval "`setcfg "$xbmktmp/cbcfg" 1`"
setvfile "$@" && return 1; :
setvfile "$@" || return 1; :
}
scankconfig()
+16 -14
View File
@@ -219,20 +219,8 @@ setvfile()
[ -n "$vcfg" ] && check_vcfg && for c in $cvchk; do
eval "[ \"\${$c}\" = \"/dev/null\" ] && continue"
eval "[ -z \"\${$c}\" ] && continue"
# valid vcfg. proceed to download files
eval "`setcfg "$vfile"`"
bootstrap
[ $# -gt 0 ] && getfiles
[ $# -gt 0 ] && return 1 # download
fx_ prep x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
( check_vendor_hashes ) || err "$archive: Can't verify hashes"
return 1
done && return 0; return 1
getvfile "$@" && return 0
done && return 1; :
}
check_vcfg()
@@ -242,6 +230,20 @@ check_vcfg()
[ -f "$vfile" ] || err "'$archive', '$board': $vfile missing"; :
}
getvfile()
{
# valid vcfg. proceed to download files
eval "`setcfg "$vfile"`"
bootstrap
[ $# -gt 0 ] && getfiles
[ $# -gt 0 ] && return 0 # download
fx_ prep x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
( check_vendor_hashes ) || err "$archive: Can't verify hashes"; :
}
bootstrap()
{
cbdir="src/coreboot/$tree"