summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-07-23 09:39:51 -0700
committerCommit Bot <commit-bot@chromium.org>2019-07-23 21:15:03 +0000
commite7ab9a9193bf1545292cfdcfd7f3d3f5352eef84 (patch)
treef3bc15256b66e4859068b2f7d155c8b62966801f /util
parent1c025a41c426acf4c554308aa19653fddb1b4e17 (diff)
downloadchrome-ec-e7ab9a9193bf1545292cfdcfd7f3d3f5352eef84.tar.gz
signer: improve debug reporting of the signer script
In case sighing failure happens, let's not delete temporary files and let's report the full failed signer invocation command line so that it is easy to debug the problem. BRANCH=none BUG=none TEST=debugged failure to sign the MP image which happened after transitioning into a new sighing environment. Change-Id: I55accb6887ad00103c9aa7b69aa373f886bce64e Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715325 Reviewed-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/signer/bs8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/signer/bs b/util/signer/bs
index 8c6b3a3822..23ee46039a 100755
--- a/util/signer/bs
+++ b/util/signer/bs
@@ -16,7 +16,7 @@ progname=$(basename $0)
OD="/usr/bin/od"
tmpf="/tmp/bs_manifest.$$"
-trap "{ rm -rf [01].flat ${tmpf} ; }" EXIT
+trap "{ if [[ -f 1.flat ]]; then rm -rf [01].flat ${tmpf} ; fi; }" EXIT
usage() {
local rv="${1}"
@@ -307,9 +307,9 @@ for elf in ${elves[@]}; do
# Make sure output file is not owned by root
touch "${signed_file}"
- if ! "${SIGNER}" ${signer_command_params[@]} \
- -i ${elf} -o "${signed_file}"; then
- echo "${progname}: ${SIGNER} failed" >&2
+ command="${SIGNER} ${signer_command_params[@]} -i ${elf} -o ${signed_file}"
+ if ! ${command}; then
+ echo "${progname}: \"${command}\" failed" >&2
exit 1
fi