From 62a335fd0624d71fbcff7f406ccb9099a8ef4ea8 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 15 Nov 2010 08:37:39 -0500 Subject: [PATCH] Set pipefail before running get_init_cpio This addresses FS#20638, where gen_init_cpio fails, but the pipeline still reports no error because gzip exits successfully. Setting pipefail insures that if anything goes wrong with gen_init_cpio, the operation is deemed a failure and the user isn't unknowingly left with a faulty initcpio. --- mkinitcpio | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/mkinitcpio b/mkinitcpio index 0865482..e0b29e3 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -277,6 +277,7 @@ fi status=0 if [ -n "${GENIMG}" ]; then echo -n ":: Generating image '${GENIMG}'..." + shopt -s -o pipefail if ! /sbin/gen_init_cpio ${FILELIST} | ${COMPRESSION} -9 > "${GENIMG}"; then echo "FAILED" status=1 -- 1.7.3.2