summaryrefslogtreecommitdiffstats
path: root/kernel.spec
diff options
context:
space:
mode:
authorPeter Robinson <pbrobinson@gmail.com>2019-06-21 22:02:13 +0100
committerPeter Robinson <pbrobinson@gmail.com>2019-06-21 22:04:20 +0100
commitb0bc74c2361e228231f13ad8a79f939517f492f9 (patch)
treed2b4afb0be7acdf63059edf5fb201693b6d9ceeb /kernel.spec
parent2a7e3ab552d110e7a2f4eaa9325ba2709a93f828 (diff)
downloadkernel-b0bc74c2361e228231f13ad8a79f939517f492f9.tar.gz
kernel-b0bc74c2361e228231f13ad8a79f939517f492f9.tar.xz
kernel-b0bc74c2361e228231f13ad8a79f939517f492f9.zip
enable parallel xz compression of modules
So this uses the -P option for xargs to allow parallel compression of xz uaing xargs options, it allows maximum usage of available CPUs it can be reverted to the prior status quo but running the following sed -i 's/global zcpu `nproc --all`/global zcpu 1/' kernel.spec
Diffstat (limited to 'kernel.spec')
-rw-r--r--kernel.spec4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel.spec b/kernel.spec
index 660d948d0..c9882313a 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -22,6 +22,8 @@ Summary: The Linux kernel
%if %{zipmodules}
%global zipsed -e 's/\.ko$/\.ko.xz/'
+# for parallel xz processes, replace with 1 to go back to single process
+%global zcpu `nproc --all`
%endif
# define buildid .local
@@ -1559,7 +1561,7 @@ BuildKernel %make_target %kernel_image %{_use_vdso}
fi \
fi \
if [ "%{zipmodules}" -eq "1" ]; then \
- find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs xz; \
+ find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} xz; \
fi \
%{nil}