Skip to content

redhat/kernel.spec.template: Parallelize compression

Prarit Bhargava requested to merge prarit/kernel-ark:xz_parallel into os-build

This line in the kernel.spec file:

find RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P{RPM_BUILD_NCPUS} -r xz;

implies that ${RPM_BUILD_NCPUS} xz instances are run. This is not true,
and this line actually applies ${RPM_BUILD_NCPUS} to a single instance of
xz. This means that the compression has been done one module at a time
(ie, in serial) rather than in parallel as is implied by the code.

Use xarg's -n option to assign one cpu per process and parallelize the
compression.

Suggested-by: "Herton R. Krzesinski" herton@redhat.com
Signed-off-by: Prarit Bhargava prarit@redhat.com

Edited by Prarit Bhargava

Merge request reports