summaryrefslogtreecommitdiff
path: root/resources/scripts/download/coreboot
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-05-15 02:30:14 +0100
committerLeah Rowe <leah@libreboot.org>2023-05-15 02:30:14 +0100
commitd28584f3d039adc3753e0051081f68b96f1ecadd (patch)
treeeb5ff9e5cb04a5acd7269e65e8b895312b1fc946 /resources/scripts/download/coreboot
parent162f4bf5ddd5edb584c2821cad16230e0fee2ed0 (diff)
download/coreboot: fetch config in new function
Diffstat (limited to 'resources/scripts/download/coreboot')
-rwxr-xr-xresources/scripts/download/coreboot69
1 files changed, 37 insertions, 32 deletions
diff --git a/resources/scripts/download/coreboot b/resources/scripts/download/coreboot
index ec99a26f..e0c55c9c 100755
--- a/resources/scripts/download/coreboot
+++ b/resources/scripts/download/coreboot
@@ -78,38 +78,8 @@ download_coreboot_for_board()
cbtree="undefined"
cbrevision="undefined"
- while true; do
- cbrevision="undefined"
- cbtree="undefined"
-
- check_config_for_board "${_board}" || return 1
-
- # This is to override $cbrevision and $cbtree
- . "resources/coreboot/${_board}/board.cfg" \
- || touch ../build_error
- if [ -f build_error ]; then
- printf "ERROR: download/coreboot:"
- printf " problem sourcing %s/board.cfg\n" ${_board}
- return 1
- elif [ "${_board}" != "${cbtree}" ]; then
- _board="${cbtree}"
- continue
- elif [ "${cbtree}" = "undefined" ]; then
- printf "ERROR: download/coreboot:"
- printf " tree name undefined for '%s\n'" \
- ${_board}
- return 1
- elif [ "${cbrevision}" = "undefined" ]; then
- printf "ERROR: download/coreboot:"
- printf " commit ID undefined for '%s'\n" \
- ${_board}
- return 1
- else
- break
- fi
- done
-
- rm -f resources/coreboot/*/seen
+ fetch_coreboot_config "${_board}"; rm -f resources/coreboot/*/seen
+ [ -f build_error ] && return 1
if [ -d "coreboot/${cbtree}" ]; then
printf "REMARK: download/coreboot %s: exists. Skipping.\n" \
@@ -218,6 +188,41 @@ download_coreboot_for_board()
fi
}
+fetch_coreboot_coreboot()
+{
+ while true; do
+ cbrevision="undefined"
+ cbtree="undefined"
+
+ check_config_for_board "${_board}" || return 1
+
+ # This is to override $cbrevision and $cbtree
+ . "resources/coreboot/${_board}/board.cfg" \
+ || touch ../build_error
+ if [ -f build_error ]; then
+ printf "ERROR: download/coreboot:"
+ printf " problem sourcing %s/board.cfg\n" ${_board}
+ return 1
+ elif [ "${_board}" != "${cbtree}" ]; then
+ _board="${cbtree}"
+ continue
+ elif [ "${cbtree}" = "undefined" ]; then
+ printf "ERROR: download/coreboot:"
+ printf " tree name undefined for '%s\n'" \
+ ${_board}
+ return 1
+ elif [ "${cbrevision}" = "undefined" ]; then
+ printf "ERROR: download/coreboot:"
+ printf " commit ID undefined for '%s'\n" \
+ ${_board}
+ return 1
+ else
+ break
+ fi
+ done
+ return 0
+}
+
check_config_for_board()
{
if [ ! -f "resources/coreboot/${1}/board.cfg" ]; then