From b0bc74c2361e228231f13ad8a79f939517f492f9 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Fri, 21 Jun 2019 22:02:13 +0100 Subject: [PATCH] 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 --- kernel.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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}