download/mrc: handle exit status within subshell
the previous code merely exited from the subshell, but the intended behaviour is for the entire script to halt execution, and exit with non-zero status. this patch fixes that bug.fsdg20230625
parent
963b524722
commit
7b36ffc1e5
|
@ -43,8 +43,11 @@ _mrc_complete="mrc/haswell/mrc.bin"
|
||||||
cbdir="coreboot/default"
|
cbdir="coreboot/default"
|
||||||
cbfstool="${cbdir}/util/cbfstool/cbfstool"
|
cbfstool="${cbdir}/util/cbfstool/cbfstool"
|
||||||
|
|
||||||
|
sname=""
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
sname=${0}
|
||||||
printf "Downloading Intel MRC blobs\n"
|
printf "Downloading Intel MRC blobs\n"
|
||||||
|
|
||||||
check_existing && exit 0
|
check_existing && exit 0
|
||||||
|
@ -90,9 +93,7 @@ fetch_mrc()
|
||||||
download_image ${_url2} ${_file} ${_sha1sum}
|
download_image ${_url2} ${_file} ${_sha1sum}
|
||||||
fi
|
fi
|
||||||
if [ ! -f $_file ]; then
|
if [ ! -f $_file ]; then
|
||||||
printf "%s not downloaded / verification failed. Exiting.\n" \
|
fail "%{_file} not downloaded / verification failed."
|
||||||
${_file}
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
extract_partition ROOT-A ${_file} root-a.ext2
|
extract_partition ROOT-A ${_file} root-a.ext2
|
||||||
|
@ -173,4 +174,11 @@ extract_coreboot()
|
||||||
rm -r "${_unpacked}"
|
rm -r "${_unpacked}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fail()
|
||||||
|
{
|
||||||
|
printf "%s: ERROR: %s\n"
|
||||||
|
${sname} ${1}
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
main $@
|
main $@
|
||||||
|
|
Loading…
Reference in New Issue