From 0b5ce7cd3e4655af03133718f0a92883425b9c6c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Jul 2010 12:48:56 +0200 Subject: initramfs-tools: output name of script that errexits. this should make bug reports concerning bogus hook scripts easier to handle, like the *loooong* iscan story. Closes: 586554 Signed-off-by: maximilian attems --- scripts/functions | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/functions') diff --git a/scripts/functions b/scripts/functions index 364cc27..d42a3cf 100644 --- a/scripts/functions +++ b/scripts/functions @@ -211,7 +211,6 @@ get_prereq_pairs() call_scripts() { - # allow hooks to abort build: set -e for cs_x in ${runlist}; do [ -f ${initdir}/${cs_x} ] || continue @@ -219,7 +218,12 @@ call_scripts() if [ "${verbose}" = "y" ]; then echo "Calling hook ${cs_x}" fi - ${initdir}/${cs_x} + ${initdir}/${cs_x} && ec=$? || ec=$? + # allow hooks to abort build: + if [ "$ec" -ne 0 ]; then + echo "E: ${initdir}/${cs_x} failed with return $ec." + exit $ec + fi # allow boot scripts to modify exported boot parameters if [ -e /conf/param.conf ]; then . /conf/param.conf -- cgit v1.2.3