]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Use builtin xz/lzma option to use all cores for multihreaded compression
authorKoen Kooi <koen@dominion.thruhere.net>
Fri, 10 Jan 2014 20:41:43 +0000 (21:41 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 24 Jan 2014 11:49:16 +0000 (12:49 +0100)
This removes the dependency on 'getconf' as well, which is not installed by default on my embedded systems.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
dracut.sh

index 7ae5a58b379d54ac33d63989ebe9c1e270d11d45..f219dcc0649c7a55025fee3db5e9def98c663bdd 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -699,14 +699,12 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
 # eliminate IFS hackery when messing with fw_dir
 fw_dir=${fw_dir//:/ }
 
-cpu_count=$(getconf _NPROCESSORS_ONLN)
-
 # handle compression options.
 [[ $compress ]] || compress="gzip"
 case $compress in
     bzip2) compress="bzip2 -9";;
-    lzma)  compress="lzma -9 ${cpu_count:+-T$cpu_count}";;
-    xz)    compress="xz --check=crc32 --lzma2=dict=1MiB ${cpu_count:+-T$cpu_count}";;
+    lzma)  compress="lzma -9 -T0";;
+    xz)    compress="xz --check=crc32 --lzma2=dict=1MiB -T0";;
     gzip)  compress="gzip -9"; command -v pigz > /dev/null 2>&1 && compress="pigz -9";;
     lzo)   compress="lzop -9";;
     lz4)   compress="lz4 -9";;