diff options
author | Leah Rowe <leah@libreboot.org> | 2023-08-23 18:56:31 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-08-23 19:12:00 +0100 |
commit | 57adbc6eb1f961ee9116904b667f30efb3f2de4f (patch) | |
tree | 73cff95e43ecbab6db374160ec5657b2853c6826 /resources/scripts/update/blobs/mrc | |
parent | b3fbcdf66eb6225128e2578788e085e1b1eedf34 (diff) |
unify err functions across scripts
include/err.sh
this new handling also does mundane things,
such as tell you what script b0rked
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'resources/scripts/update/blobs/mrc')
-rwxr-xr-x | resources/scripts/update/blobs/mrc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/resources/scripts/update/blobs/mrc b/resources/scripts/update/blobs/mrc index 14a1d2b6..b4502c14 100755 --- a/resources/scripts/update/blobs/mrc +++ b/resources/scripts/update/blobs/mrc @@ -17,6 +17,9 @@ [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e + +. "include/err.sh" + export PATH="${PATH}:/sbin" # This file is forked from util/chromeos/crosfirmware.sh in coreboot cfc26ce278 @@ -51,8 +54,8 @@ main() printf "Downloading Intel MRC blobs\n" check_existing && exit 0 - build_dependencies || fail "could not build dependencies" - fetch_mrc || fail "could not fetch mrc.bin" + build_dependencies || err "could not build dependencies" + fetch_mrc || err "could not fetch mrc.bin" } check_existing() @@ -85,7 +88,7 @@ fetch_mrc() [ -f ${_file} ] || \ download_image ${_url2} ${_file} ${_sha1sum} [ -f $_file ] || \ - fail "%{_file} not downloaded / verification failed." + err "%{_file} not downloaded / verification failed." extract_partition ROOT-A ${_file} root-a.ext2 extract_shellball root-a.ext2 chromeos-firmwareupdate-${_board} @@ -93,7 +96,7 @@ fetch_mrc() extract_coreboot chromeos-firmwareupdate-${_board} ../../${cbfstool} coreboot-*.bin extract -f mrc.bin -n mrc.bin \ - -r RO_SECTION || fail "Could not fetch mrc.bin" + -r RO_SECTION || err "Could not fetch mrc.bin" rm -f "chromeos-firmwareupdate-${_board}" coreboot-*.bin \ "${_file}" "root-a.ext2" @@ -166,11 +169,4 @@ extract_coreboot() rm -r "${_unpacked}" } -fail() -{ - printf "%s: ERROR: %s\n" - ${sname} ${1} - exit 1 -} - main $@ |