diff options
author | Mike Pagano <mpagano@gentoo.org> | 2022-06-11 14:59:34 -0400 |
---|---|---|
committer | Mike Pagano <mpagano@gentoo.org> | 2022-06-11 14:59:34 -0400 |
commit | eee74b9fca1b5237299ee08fd041997e7271304a (patch) | |
tree | d151edf962fa2a06bfb87ea0fb23a23528d12a10 /eclass | |
parent | dev-python/owslib: add 0.26.0 (diff) | |
download | gentoo-eee74b9fca1b5237299ee08fd041997e7271304a.tar.gz gentoo-eee74b9fca1b5237299ee08fd041997e7271304a.tar.bz2 gentoo-eee74b9fca1b5237299ee08fd041997e7271304a.zip |
linux-mod.eclass: Support module compression
The Linux kernel supports the compression of modules utilizing GZIP, XZ
and ZSTD. Add support into linux-mod.eclass to support this for out of
tree modules utilizing the compression binary specified in the kernel
config.
Note that if the binary which provides the compression is not present on
the system the kernel would have failed to build with an error
indicating the missing binaries name.
Closes: https://bugs.gentoo.org/850130
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/linux-mod.eclass | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass index 6a820371b767..b7c13cbf7e76 100644 --- a/eclass/linux-mod.eclass +++ b/eclass/linux-mod.eclass @@ -711,7 +711,22 @@ linux-mod_src_install() { einfo "Installing ${modulename} module" cd "${objdir}" || die "${objdir} does not exist" insinto "${INSTALL_MOD_PATH}"/lib/modules/${KV_FULL}/${libdir} - doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed" + + # check here for CONFIG_MODULE_COMPRESS_<compression option> (NONE, GZIP, XZ, ZSTD) + # and similarily compress the module being built if != NONE. + + if linux_chkconfig_present MODULE_COMPRESS_XZ; then + xz ${modulename}.${KV_OBJ} + doins ${modulename}.${KV_OBJ}.xz || die "doins ${modulename}.${KV_OBJ}.xz failed" + elif linux_chkconfig_present MODULE_COMPRESS_GZIP; then + gzip ${modulename}.${KV_OBJ} + doins ${modulename}.${KV_OBJ}.gz || die "doins ${modulename}.${KV_OBJ}.gz failed" + elif linux_chkconfig_present MODULE_COMPRESS_ZSTD; then + zstd ${modulename}.${KV_OBJ} + doins ${modulename}.${KV_OBJ}.zst || die "doins ${modulename}.${KV_OBJ}.zst failed" + else + doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed" + fi cd "${OLDPWD}" generate_modulesd "${objdir}/${modulename}" |