Just test the status of the cpio-and-compress pipe directly.

master
Victor Lowther 2010-08-14 14:23:25 -05:00 committed by Harald Hoyer
parent 5b158ad3a9
commit 937f678ef6
1 changed files with 2 additions and 2 deletions

4
dracut
View File

@ -340,8 +340,8 @@ type hardlink &>/dev/null && {
}

[[ $compress = gzip* ]] && type pigz > /dev/null 2>&1 && compress="pigz -9"
( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet |$compress > "$outfile"; )
if [ $? -ne 0 ]; then
if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet | \
$compress > "$outfile"; ); then
derror "dracut: creation of $outfile failed"
exit 1
fi