Adjusts kernel-install_compress_modules to use the new function dist-kernel_get_module_suffix. This makes no functional difference
at the moment since gentoo-kernel-bin is the only consumer and it has
XZ compression in the config. Still this makes it possible to compile
alternate prebuilt kernels with alternate module compression support, and may in the future help to support gzip and zstd module compression in gentoo-kernel-bin.
Signed-off-by: Andrew Ammerlaan <
andrewammerlaan@gentoo.org>
---
eclass/kernel-install.eclass | 36 +++++++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 7 deletions(-)
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 0a85bfb8629d..e5dd6db5b7ed 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -766,13 +766,35 @@ kernel-install_compress_modules() {
if use modules-compress; then
einfo "Compressing kernel modules ..."
- # 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
+ if [[ -z ${KV_FULL} ]]; then
+ KV_FULL=${PV}${KV_LOCALVERSION}
+ fi
+ local suffix=$(dist-kernel_get_module_suffix "${ED}/usr/src/linux-${KV_FULL}")
+ local compress=()
+ # Options taken from linux-mod-r1.eclass.
+ #