From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5D87A158020 for ; Tue, 11 Oct 2022 22:56:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9A066E0937; Tue, 11 Oct 2022 22:55:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5CD5FE0934 for ; Tue, 11 Oct 2022 22:55:14 +0000 (UTC) From: Sam James To: gentoo-dev@lists.gentoo.org Cc: dist-kernel@gentoo.org, kernel@gentoo.org, Sam James Subject: [gentoo-dev] [PATCH 6/8] kernel-build.eclass: compress xz/zstd in parallel Date: Tue, 11 Oct 2022 23:54:42 +0100 Message-Id: <20221011225444.56032-6-sam@gentoo.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011225444.56032-1-sam@gentoo.org> References: <20221011225444.56032-1-sam@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: e3dc8126-d88e-4f1d-ab11-ce3bcfb73c64 X-Archives-Hash: 9cf5052105b28cfc766e33f343d1a42e 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(-) 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" -- 2.38.0