summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-01-16 21:13:59 +0100
committerMichał Górny <mgorny@gentoo.org>2024-01-17 08:40:59 +0100
commit298c5096882846df2b215fede1c443f92aa5c6c6 (patch)
tree8efd82c3e8468d49992ea311d403ac94dfcbfebe /eclass/kernel-install.eclass
parentdev-python/tables: Bump blosc2 dep (diff)
downloadgentoo-298c5096882846df2b215fede1c443f92aa5c6c6.tar.gz
gentoo-298c5096882846df2b215fede1c443f92aa5c6c6.tar.bz2
gentoo-298c5096882846df2b215fede1c443f92aa5c6c6.zip
kernel-install.eclass: Compress kernel modules in parallel
Closes: https://bugs.gentoo.org/922185 Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/34843 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/kernel-install.eclass')
-rw-r--r--eclass/kernel-install.eclass13
1 files changed, 9 insertions, 4 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 9ab96628b5e4..2b6e80aee571 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -50,7 +50,7 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-inherit dist-kernel-utils mount-boot toolchain-funcs
+inherit dist-kernel-utils mount-boot multiprocessing toolchain-funcs
SLOT="${PV}"
IUSE="+initramfs test"
@@ -756,9 +756,14 @@ kernel-install_compress_modules() {
if use modules-compress; then
einfo "Compressing kernel modules ..."
- # taken from scripts/Makefile.modinst
- find "${ED}/lib" -name '*.ko' -exec \
- xz --check=crc32 --lzma2=dict=1MiB {} + || die
+ # xz options taken from scripts/Makefile.modinst
+ # we don't do 'xz -T' because it applies multithreading per file,
+ # so it works only for big files, and we have lots of small files
+ # instead
+ find "${ED}/lib" -name '*.ko' -print0 |
+ xargs -0 -P "$(makeopts_jobs)" -n 128 \
+ xz --check=crc32 --lzma2=dict=1MiB
+ assert "Compressing kernel modules failed"
fi
}