diff options
Diffstat (limited to 'resources/scripts/download/mrc')
-rwxr-xr-x | resources/scripts/download/mrc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/resources/scripts/download/mrc b/resources/scripts/download/mrc index 63ec0100..ed0b38f3 100755 --- a/resources/scripts/download/mrc +++ b/resources/scripts/download/mrc @@ -51,8 +51,8 @@ main() printf "Downloading Intel MRC blobs\n" check_existing && exit 0 - build_dependencies - fetch_mrc + build_dependencies || fail "could not build dependencies" + fetch_mrc || fail "could not fetch mrc.bin" } check_existing() @@ -74,16 +74,17 @@ check_existing() build_dependencies() { if [ ! -d "${cbdir}/" ]; then - ./download coreboot default + ./download coreboot default || return 1 fi if [ ! -f "${cbfstool}" ]; then - ./build module cbutils default + ./build module cbutils default || return 1 fi + return 0 } fetch_mrc() { - mkdir -p mrc/haswell/ + mkdir -p mrc/haswell/ || return 1 ( cd mrc/haswell/ @@ -102,22 +103,25 @@ fetch_mrc() extract_coreboot chromeos-firmwareupdate-${_board} ../../${cbfstool} coreboot-*.bin extract -f mrc.bin \ - -n mrc.bin -r RO_SECTION + -n mrc.bin -r RO_SECTION \ + || fail "Could not fetch mrc.bin" rm -f "chromeos-firmwareupdate-${_board}" coreboot-*.bin \ "${_file}" "root-a.ext2" printf "\n\nmrc.bin saved to ${_mrc_complete}\n\n" ) + + return 0 } download_image() { - _url=${1} + url=${1} _file=${2} _sha1sum=${3} echo "Downloading recovery image" - curl "$_url" > "$_file.zip" + curl "$url" > "$_file.zip" if [ "$(sha1sum ${_file}.zip | awk '{print $1}')" = "${_sha1sum}" ] then unzip -q "${_file}.zip" |