summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2010-07-08 11:27:06 +0200
committermaximilian attems <maks@debian.org>2010-07-08 14:55:21 +0200
commit961341244f4c4eb5c565b638755844778da49ff4 (patch)
tree7d57a7cef33d5aca59929d875e40c411a33c54c3
parent210c83c797e16623bb727fa47960d514d8e8c510 (diff)
downloadinitramfs-tools-961341244f4c4eb5c565b638755844778da49ff4.tar.gz
initramfs-tools-961341244f4c4eb5c565b638755844778da49ff4.zip
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 <maks@debian.org>
-rwxr-xr-xmkinitramfs15
1 files 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