blob: 7dc62ded76ea05c65d013fbe692b6fe7ee7cec07 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
From c92ea797c43aa811e98b6bd8fb4aae921fa08592 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Fri, 10 Jan 2014 21:11:40 +0100
Subject: [PATCH] Use builtin xz/lzma option to use all cores for multihreaded
compression
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>
Upstream-status: Submitted
---
dracut.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 11dcd0e..2e6ea67 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -697,14 +697,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";;
--
1.8.0
|