Cache downloads based on checksum

Since many boards use the same ME firmware, we could save
everyone's bandwidth and time by caching the update files.

Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
fsdg20230625
Riku Viitanen 2023-06-17 18:13:04 +03:00
parent 25474414cf
commit 0f4f32cfc2
2 changed files with 5 additions and 2 deletions

2
.gitignore vendored
View File

@ -39,7 +39,7 @@
/version
/versiondate
/blobs/app/
/blobs/vendorupdate
/blobs/cache/
*me.bin
/mrc/
/util/nvmutil/nvm

View File

@ -11,6 +11,7 @@ ec_hash=""
dl_hash=""
dl_url=""
dl_url_bkup=""
dl_path=""
e6400_vga_dl_hash=""
e6400_vga_dl_url=""
e6400_vga_dl_url_bkup=""
@ -21,7 +22,6 @@ cbdir="coreboot/default"
cbcfgsdir="resources/coreboot"
boarddir=""
blobdir="blobs"
dl_path="${blobdir}/vendorupdate"
appdir="${blobdir}/app"
_7ztest="a"
mecleaner="$(pwd)/me_cleaner/me_cleaner.py"
@ -431,6 +431,9 @@ fetch_update()
return 1
fi
dl_path=${blobdir}/cache/${dlsum}
mkdir -p ${blobdir}/cache
vendor_checksum ${dlsum} || \
wget ${dl} -O ${dl_path} || wget ${dl_bkup} -O ${dl_path}