From 11b2dd23d0346810812e8b07ba1f8e5f06ae470d Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 11 Oct 2022 20:54:56 +0100 Subject: kernel-build.eclass: compress xz/zstd in parallel Note that this will only take effect if compressing modules with xz or zstd (COMPRESS_MODULE_XZ is set or COMPRESS_MODULE_ZSTD is set respectively) ... or if compiling the kernel with xz or zstd (COMPRESS_KERNEL_XZ or COMPRESS_KERNEL_ZSTD is set respectiely). Signed-off-by: Sam James --- eclass/kernel-build.eclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'eclass') diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass index 98a385bf72c0..936258e9e8af 100644 --- a/eclass/kernel-build.eclass +++ b/eclass/kernel-build.eclass @@ -29,7 +29,7 @@ esac PYTHON_COMPAT=( python3_{8..11} ) -inherit python-any-r1 savedconfig toolchain-funcs kernel-install +inherit multiprocessing python-any-r1 savedconfig toolchain-funcs kernel-install BDEPEND=" ${PYTHON_DEPS} @@ -90,6 +90,14 @@ kernel-build_src_configure() { ARCH=$(tc-arch-kernel) ) + if type -P xz ; then + export XZ_OPT="-T$(makeopts_jobs)" + fi + + if type -P zstd ; then + export ZSTD_NBTHREADS="$(makeopts_jobs)" + fi + restore_config .config [[ -f .config ]] || die "Ebuild error: please copy default config into .config" -- cgit v1.2.3-65-gdbad