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 8/8] kernel-build.eclass: use pbzip2/lbzip2 for parallel compression if available
Date: Tue, 11 Oct 2022 22:57:19
Message-Id: 20221011225444.56032-8-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 bzip2 (COMPRESS_MODULE_BZIP2 is set) or
3 compressing the kernel with bzip2 (CONFIG_KERNEL_BZIP2 is set).
4
5 Signed-off-by: Sam James <sam@g.o>
6 ---
7 eclass/kernel-build.eclass | 10 ++++++++--
8 1 file changed, 8 insertions(+), 2 deletions(-)
9
10 diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
11 index faf36d763d08..cc99298811bc 100644
12 --- a/eclass/kernel-build.eclass
13 +++ b/eclass/kernel-build.eclass
14 @@ -98,13 +98,19 @@ kernel-build_src_configure() {
15 export ZSTD_NBTHREADS="$(makeopts_jobs)"
16 fi
17
18 - # pigz needs to take an argument, not an env var,
19 - # for its options, which won't work because of how the kernel build system
20 + # pigz/pbzip2/lbzip2 all need to take an argument, not an env var,
21 + # for their options, which won't work because of how the kernel build system
22 # uses the variables (e.g. passes directly to tar as an executable).
23 if type -P pigz ; then
24 MAKEARGS+=( KGZIP="pigz" )
25 fi
26
27 + if type -P pbzip2 ; then
28 + MAKEARGS+=( KBZIP2="pbzip2" )
29 + elif type -P lbzip2 ; then
30 + MAKEARGS+=( KBZIP2="lbzip2" )
31 + fi
32 +
33 restore_config .config
34 [[ -f .config ]] || die "Ebuild error: please copy default config into .config"
35
36 --
37 2.38.0

Replies