Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: dist-kernel@g.o, kernel@g.o, Sam James <sam@g.o>
Subject: [gentoo-dev] [PATCH 6/8] kernel-build.eclass: compress xz/zstd in parallel
Date: Tue, 11 Oct 2022 22:56:44
Message-Id: 20221011225444.56032-6-sam@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/8] kernel-2.eclass: decompress xz in parallel by Sam James
1 Note that this will only take effect if compressing
2 modules with xz or zstd (COMPRESS_MODULE_XZ is set or
3 COMPRESS_MODULE_ZSTD is set respectively)
4
5 ... or if compiling the kernel with xz or zstd (COMPRESS_KERNEL_XZ
6 or COMPRESS_KERNEL_ZSTD is set respectiely).
7
8 Signed-off-by: Sam James <sam@g.o>
9 ---
10 eclass/kernel-build.eclass | 10 +++++++++-
11 1 file changed, 9 insertions(+), 1 deletion(-)
12
13 diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
14 index 98a385bf72c0..936258e9e8af 100644
15 --- a/eclass/kernel-build.eclass
16 +++ b/eclass/kernel-build.eclass
17 @@ -29,7 +29,7 @@ esac
18
19 PYTHON_COMPAT=( python3_{8..11} )
20
21 -inherit python-any-r1 savedconfig toolchain-funcs kernel-install
22 +inherit multiprocessing python-any-r1 savedconfig toolchain-funcs kernel-install
23
24 BDEPEND="
25 ${PYTHON_DEPS}
26 @@ -90,6 +90,14 @@ kernel-build_src_configure() {
27 ARCH=$(tc-arch-kernel)
28 )
29
30 + if type -P xz ; then
31 + export XZ_OPT="-T$(makeopts_jobs)"
32 + fi
33 +
34 + if type -P zstd ; then
35 + export ZSTD_NBTHREADS="$(makeopts_jobs)"
36 + fi
37 +
38 restore_config .config
39 [[ -f .config ]] || die "Ebuild error: please copy default config into .config"
40
41 --
42 2.38.0

Replies