]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut: use pigz, if available and no compress defined
authorHarald Hoyer <harald@redhat.com>
Tue, 31 May 2011 11:58:08 +0000 (13:58 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 31 May 2011 12:56:31 +0000 (14:56 +0200)
dracut

diff --git a/dracut b/dracut
index 5365fbe7b57ee44856a60acd342144b56acd19ac..079d5be649316c95cc824d798d4b55f5ce99377f 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -366,11 +366,12 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
 fw_dir=${fw_dir//:/ }
 
 # handle compression options.
+[[ $compress ]] || compress="gzip"
 case $compress in
     bzip2) compress="bzip2 -9";;
     lzma)  compress="lzma -9";;
     xz)    compress="xz --check=crc32 --lzma2=dict=1MiB";;
-    gzip)  type pigz > /dev/null 2>&1 && compress="pigz -9" || \
+    gzip)  command -v pigz > /dev/null 2>&1 && compress="pigz -9" || \
                                          compress="gzip -9";;
 esac
 if [[ $_no_compress_l = "cat" ]]; then
@@ -379,7 +380,6 @@ fi
 
 [[ $hostonly = yes ]] && hostonly="-h"
 [[ $hostonly != "-h" ]] && unset hostonly
-[[ $compress ]] || compress="gzip -9"
 
 if [[ -f $dracutbasedir/dracut-functions ]]; then
     . $dracutbasedir/dracut-functions