summaryrefslogtreecommitdiff
path: root/script/update/blobs/download
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-30 01:31:40 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-30 12:31:30 +0100
commit385eb90c8cd31bfb770a950dd9252a30ccd6955d (patch)
treeded66bc53f6f13ec8d87266f5c38d46b2e1d8b17 /script/update/blobs/download
parent9f5a5450afda39973d9da4fa3bed97c365a5acd2 (diff)
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 <leah@libreboot.org>
Diffstat (limited to 'script/update/blobs/download')
-rwxr-xr-xscript/update/blobs/download26
1 files changed, 9 insertions, 17 deletions
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"