From 2e779a54951406247197cf21a31c54a36ec1fa06 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 11 Dec 2023 05:21:27 +0000 Subject: handle errors on exits from subshells most of these are probably redundant, and will never be called, but lbmk needs to be as safe as possible under fault conditions. fail early, fail hard. Signed-off-by: Leah Rowe --- include/git.sh | 4 ++-- include/mrc.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/git.sh b/include/git.sh index 49148224..811b298a 100755 --- a/include/git.sh +++ b/include/git.sh @@ -72,7 +72,7 @@ prepare_new_tree() git submodule update --init --checkout || \ err "prepare_new_tree ${project}/${tree}: !submodules" fi - ) + ) || err "git submodule update failure" git_am_patches "${tmp_git_dir}" "$PWD/$cfgsdir/$tree/patches" || \ err "prepare_new_tree ${project}/${tree}: patch fail" [ "${patchfail}" = "y" ] && err "PATCH FAIL" @@ -138,7 +138,7 @@ git_reset_rev() git submodule update --init --checkout || \ err "git_reset_rev ${1}: can't download submodules" fi - ) + ) || err "git reset fail" } git_am_patches() diff --git a/include/mrc.sh b/include/mrc.sh index e57026a4..929aed7a 100755 --- a/include/mrc.sh +++ b/include/mrc.sh @@ -20,7 +20,7 @@ extract_mrc() extract_partition extract_shellball extract_coreboot - ) + ) || err "mrc download/extract failure" "${cbfstool}" "${appdir}/"coreboot-*.bin extract -n mrc.bin \ -f "${_dest}" -r RO_SECTION || err "extract_mrc: cbfstool ${_dest}" -- cgit v1.2.1