summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorshmalebx9 <thonkpeasant@protonmail.com>2022-11-20 14:32:25 -0700
committershmalebx9 <thonkpeasant@protonmail.com>2022-11-20 14:32:25 -0700
commit1246c3adb98d245302d9fa574d3eadcb83144a82 (patch)
tree7672bf956546bc06741d5ddc56968f21e916a535 /resources
parent7629dfb8afa81af71ead2d7e1b2c3a7b91849c8d (diff)
add smort failures to blob download script
Diffstat (limited to 'resources')
-rwxr-xr-xresources/scripts/blobs/download19
1 files changed, 12 insertions, 7 deletions
diff --git a/resources/scripts/blobs/download b/resources/scripts/blobs/download
index c274e9d1..b9471946 100755
--- a/resources/scripts/blobs/download
+++ b/resources/scripts/blobs/download
@@ -14,6 +14,11 @@ else
redistributable=false
fi
+Fail(){
+ printf "\nERROR: $@\n"
+ exit 1
+}
+
Download_needed(){
for need in ${needs}; do
case ${need} in
@@ -27,8 +32,7 @@ Download_needed(){
done
if [ ! -z ${_failed+x} ]; then
- printf "\nERROR: failed to obtain${_failed}\nrun: './blobutil extract ${board} /path/to/romdump.rom' to extract the remaining blobs\n"
- exit 1
+ Fail "failed to obtain ${_failed}\nYou may try manually extracting blobs with './blobutil extract'"
fi
}
@@ -68,27 +72,28 @@ Extract_me(){
return 1
fi
- ( cd blobs && innoextract me.exe )
printf 'extracting and stripping intel management engine\n'
+ innoextract blobs/me.exe -d blobs || Fail 'could not extract me executable with innoextract'
./me_cleaner/me_cleaner.py -r -t -O ${_me_destination} blobs/app/*ME*.bin \
- || ./resources/blobs/me7_update_parser.py -O ${_me_destination} blobs/app/ME7*.bin
+ || ./resources/blobs/me7_update_parser.py -O ${_me_destination} blobs/app/ME7*.bin \
+ || return 1
printf "Truncated and cleaned me output to ${_me_destination}\n"
}
Build_deps(){
if [ ! -d me_cleaner ]; then
printf "downloading me_cleaner\n"
- ./download me_cleaner
+ ./download me_cleaner || Fail 'could not download me_cleaner'
fi
if [ ! -d coreboot/default ]; then
printf "downloading coreboot\n"
- ./download coreboot default
+ ./download coreboot default || Fail 'could not download coreboot'
fi
if [ ! -f "coreboot/default/util/ifdtool/ifdtool" ]; then
printf "building ifdtool from coreboot\n"
- ( cd coreboot/default/util/ifdtool && make )
+ ( cd coreboot/default/util/ifdtool && make ) || Fail 'could not build ifdtool'
fi
}