From 385eb90c8cd31bfb770a950dd9252a30ccd6955d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 30 Sep 2023 01:31:40 +0100 Subject: update/*/*: unified scanning of revisions/sources update/blobs/download and update/project/repo both use the same logic, for setting variables with awk and a specially formatted configuration file. unify this logic under include/option.sh, and use that. Signed-off-by: Leah Rowe --- script/update/blobs/download | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'script/update/blobs') diff --git a/script/update/blobs/download b/script/update/blobs/download index 2ccf3b77..51747824 100755 --- a/script/update/blobs/download +++ b/script/update/blobs/download @@ -7,6 +7,7 @@ . "include/err.sh" . "include/blobutil.sh" . "include/mrc.sh" +. "include/option.sh" export PATH="${PATH}:/sbin" @@ -15,10 +16,11 @@ main() [ $# -gt 0 ] || err "No argument given" board="${1}" boarddir="${cbcfgsdir}/${board}" + _b="${board%%_*mb}" # shorthand (avoid duplicating config per rom size) check_defconfig "${boarddir}" || exit 0 detect_firmware && exit 0 - scan_sources_config + scan_config "${_b}" "config/blobs" "err" build_dependencies download_blobs @@ -36,29 +38,19 @@ detect_firmware() printf "Blobs not needed for: %s\n" "${board}" 1>&2 } -scan_sources_config() -{ - _b=${board%%_*mb} # shorthand to avoid duplicating config per rom size - awkstr=" /\{.*${_b}.*}{/ {flag=1;next} /\}/{flag=0} flag { print }" - while read -r line ; do - set ${line} 1>/dev/null 2>/dev/null - eval "${1}=\"${2}\"" - done << EOF - $(eval "awk '${awkstr}' config/blobs/sources") -EOF -} - build_dependencies() { - [ -d ${cbdir} ] || ./update project trees coreboot ${cbdir##*/} || \ - err "build_dependencies: can't fetch ${cbdir}" + [ -d ${cbdir} ] || \ + ./update project trees coreboot ${cbdir##*/} || \ + err "build_dependencies: can't fetch ${cbdir}" for d in uefitool biosutilities bios_extract me_cleaner; do [ -d "${d}" ] && continue ./update project repo "${d}" || \ err "build_dependencies: can't fetch ${d}" done - [ -f uefitool/uefiextract ] || ./handle make file -b uefitool || \ - err "build_dependencies: can't build uefitool" + [ -f uefitool/uefiextract ] || \ + ./handle make file -b uefitool || \ + err "build_dependencies: can't build uefitool" [ -f "${cbdir}/util/kbc1126/kbc1126_ec_dump" ] || \ make -C "${cbdir}/util/kbc1126" || \ err "build_dependencies: can't build kbc1126_ec_dump" -- cgit v1.2.1