712866
From dfaeee7341acba43367dd26bce9143d8a5c08ac5 Mon Sep 17 00:00:00 2001
712866
From: Koen Kooi <koen@dominion.thruhere.net>
712866
Date: Fri, 10 Jan 2014 21:41:43 +0100
712866
Subject: [PATCH] Use builtin xz/lzma option to use all cores for multihreaded
712866
 compression
712866
712866
This removes the dependency on 'getconf' as well, which is not installed by default on my embedded systems.
712866
712866
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
712866
---
712866
 dracut.sh | 6 ++----
712866
 1 file changed, 2 insertions(+), 4 deletions(-)
712866
712866
diff --git a/dracut.sh b/dracut.sh
5c6c2a
index 8d572a33..ad57218d 100755
712866
--- a/dracut.sh
712866
+++ b/dracut.sh
712866
@@ -695,14 +695,12 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
712866
 # eliminate IFS hackery when messing with fw_dir
712866
 fw_dir=${fw_dir//:/ }
712866
 
712866
-cpu_count=$(getconf _NPROCESSORS_ONLN)
712866
-
712866
 # handle compression options.
712866
 [[ $compress ]] || compress="gzip"
712866
 case $compress in
712866
     bzip2) compress="bzip2 -9";;
712866
-    lzma)  compress="lzma -9 ${cpu_count:+-T$cpu_count}";;
712866
-    xz)    compress="xz --check=crc32 --lzma2=dict=1MiB ${cpu_count:+-T$cpu_count}";;
712866
+    lzma)  compress="lzma -9 -T0";;
712866
+    xz)    compress="xz --check=crc32 --lzma2=dict=1MiB -T0";;
712866
     gzip)  compress="gzip -9"; command -v pigz > /dev/null 2>&1 && compress="pigz -9";;
712866
     lzo)   compress="lzop -9";;
712866
     lz4)   compress="lz4 -9";;