From 961341244f4c4eb5c565b638755844778da49ff4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Jul 2010 11:27:06 +0200 Subject: mkinitramfs: Provide error code of failed mkinitramfs creation We better print them out before exiting, this should allow quicker diagnose of what is going on. Be sure to print out all error codes as a failure of compress is highly likely to generate an SIGPIPE aka error code 141. Silent error exits are troublesome for debugging error cause. Signed-off-by: maximilian attems --- mkinitramfs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index f8e0759..752ee45 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -327,9 +327,18 @@ eval ` } | "${compress}" >"${outfile}" echo "ec3=$?;" >&4 ` -if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi -if [ "$ec2" -ne 0 ]; then exit "$ec2"; fi -if [ "$ec3" -ne 0 ]; then exit "$ec3"; fi +if [ "$ec1" -ne 0 ]; then + echo "E: mkinitramfs failure find $ec1 cpio $ec2 $compress $ec3" + exit "$ec1" +fi +if [ "$ec2" -ne 0 ]; then + echo "E: mkinitramfs failure cpio $ec2 $compress $ec3" + exit "$ec2" +fi +if [ "$ec3" -ne 0 ]; then + echo "E: mkinitramfs failure $compress $ec3" + exit "$ec3" +fi ) || exit 1 if [ -s "${__TMPCPIOGZ}" ]; then -- cgit v1.2.3