summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-11 00:34:53 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-11 00:39:01 +0100
commit0cc816167bb7f95c1722a640066933bfdf38dd60 (patch)
tree373121b2880dbb0cec4966e697f8aa4a05f6859b
parent7d90d43425251f94adced76512310a59f2fac4dd (diff)
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>
-rw-r--r--include/inject.sh2
-rw-r--r--include/vendor.sh30
2 files changed, 17 insertions, 15 deletions
diff --git a/include/inject.sh b/include/inject.sh
index 6d910b7c..d3ea78f7 100644
--- a/include/inject.sh
+++ b/include/inject.sh
@@ -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()
diff --git a/include/vendor.sh b/include/vendor.sh
index 1c553300..e914f08d 100644
--- a/include/vendor.sh
+++ b/include/vendor.sh
@@ -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"