From c91570782c2aa9128f204a21e5d2b516658febae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
Date: Thu, 18 Mar 2010 21:41:22 +0200
Subject: [PATCH 15/15] Use pigz for gzipping if available.
---
dracut | 3 ++-
dracut-catimages | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dracut b/dracut
index 8c0adad..0ae07f2 100755
--- a/dracut
+++ b/dracut
@@ -303,7 +303,8 @@ if [[ $do_strip = yes ]] ; then
done
fi
-( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet |gzip -9 > "$outfile"; )
+type pigz &>/dev/null && gzip=pigz || gzip=gzip
+( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet |$gzip -9 > "$outfile"; )
if [ $? -ne 0 ]; then
derror "dracut: creation of $outfile failed"
exit 1
diff --git a/dracut-catimages b/dracut-catimages
index b19f20a..d49d0e2 100755
--- a/dracut-catimages
+++ b/dracut-catimages
@@ -102,7 +102,8 @@ fi
if [[ ! $no_overlay ]]; then
ofile="$imagedir/90-overlay.img"
dinfo "Creating image $ofile from directory $overlay"
- ( cd "$overlay"; find . |cpio --quiet -H newc -o |gzip -9 > "$ofile"; )
+ type pigz &>/dev/null && gzip=pigz || gzip=gzip
+ ( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
fi
if [[ ! $no_imagedir ]]; then
--
1.7.0.1