From d28584f3d039adc3753e0051081f68b96f1ecadd Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 15 May 2023 02:30:14 +0100 Subject: download/coreboot: fetch config in new function --- resources/scripts/download/coreboot | 69 ++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 32 deletions(-) (limited to 'resources') 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 -- cgit v1.2.1