diff options
author | Michał Górny <mgorny@gentoo.org> | 2023-12-25 09:36:01 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2023-12-25 16:47:33 +0100 |
commit | 824d48dae0571e5e728d93bb08619c7f0f6d10f2 (patch) | |
tree | 5478ef0e8fd0ba4ec27603d4dee0124ff10bccbb /eclass | |
parent | kernel-{build,install}.eclass: Support XZ module compression (diff) | |
download | gentoo-824d48dae0571e5e728d93bb08619c7f0f6d10f2.tar.gz gentoo-824d48dae0571e5e728d93bb08619c7f0f6d10f2.tar.bz2 gentoo-824d48dae0571e5e728d93bb08619c7f0f6d10f2.zip |
kernel-install.eclass: Add kernel-install_compress_modules
Add a function to compress modules manually. It will be used
in sys-kernel/gentoo-kernel-bin.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/kernel-install.eclass | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass index c04a21789a7c..1cbb7d54d3de 100644 --- a/eclass/kernel-install.eclass +++ b/eclass/kernel-install.eclass @@ -765,6 +765,17 @@ kernel-install_pkg_config() { kernel-install_install_all "${PV}${KV_LOCALVERSION}" } +# @FUNCTION: kernel-install_compress_modules +# @DESCRIPTION: +# Compress modules installed in ED, if USE=module-compress is enabled. +kernel-install_compress_modules() { + debug-print-function ${FUNCNAME} "${@}" + + if use module-compress; then + # taken from scripts/Makefile.modinst + find "${ED}/lib" -name '*.ko' -exec \ + xz --check=crc32 --lzma2=dict=1MiB {} + || die + fi fi EXPORT_FUNCTIONS src_test pkg_preinst pkg_postinst pkg_prerm pkg_postrm |