summaryrefslogtreecommitdiff
path: root/eclass/kernel-build.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/kernel-build.eclass')
-rw-r--r--eclass/kernel-build.eclass23
1 files changed, 22 insertions, 1 deletions
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 98a385bf72c0..1fa25cbc9574 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,27 @@ kernel-build_src_configure() {
ARCH=$(tc-arch-kernel)
)
+ if type -P xz &>/dev/null ; then
+ export XZ_OPT="-T$(makeopts_jobs)"
+ fi
+
+ if type -P zstd &>/dev/null ; then
+ export ZSTD_NBTHREADS="$(makeopts_jobs)"
+ fi
+
+ # pigz/pbzip2/lbzip2 all need to take an argument, not an env var,
+ # for their options, which won't work because of how the kernel build system
+ # uses the variables (e.g. passes directly to tar as an executable).
+ if type -P pigz &>/dev/null ; then
+ MAKEARGS+=( KGZIP="pigz" )
+ fi
+
+ if type -P pbzip2 &>/dev/null ; then
+ MAKEARGS+=( KBZIP2="pbzip2" )
+ elif type -P lbzip2 &>/dev/null ; then
+ MAKEARGS+=( KBZIP2="lbzip2" )
+ fi
+
restore_config .config
[[ -f .config ]] || die "Ebuild error: please copy default config into .config"