summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-10-11 20:54:56 +0100
committerSam James <sam@gentoo.org>2022-10-13 20:57:54 +0100
commit11b2dd23d0346810812e8b07ba1f8e5f06ae470d (patch)
treef8ff27d20a9dd6aaa044c3f707d6ef154d5dc598 /eclass/kernel-build.eclass
parentlinux-mod.eclass: cleanup whitespace (diff)
downloadgentoo-11b2dd23d0346810812e8b07ba1f8e5f06ae470d.tar.gz
gentoo-11b2dd23d0346810812e8b07ba1f8e5f06ae470d.tar.bz2
gentoo-11b2dd23d0346810812e8b07ba1f8e5f06ae470d.zip
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 <sam@gentoo.org>
Diffstat (limited to 'eclass/kernel-build.eclass')
-rw-r--r--eclass/kernel-build.eclass10
1 files changed, 9 insertions, 1 deletions
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"