• [gentoo-dev] [PATCH 1/4] profiles/use.desc: Add global USE=modules-comp

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Dec 28 11:40:01 2023
    Add a global `modules-compress` flag that controls installing compressed
    kernel modules. The primary purpose of this flag is to make it possible
    to install uncompressed modules while preserving module decompression
    support in the prebuilt dist-kernel.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    profiles/use.desc | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/profiles/use.desc b/profiles/use.desc
    index 65c809a71ddd..aa773eeb74f0 100644
    --- a/profiles/use.desc
    +++ b/profiles/use.desc
    @@ -201,6 +201,7 @@ mms - Support for Microsoft Media Server (MMS) streams
    mng - Add support for libmng (MNG images)
    modplug - Add libmodplug support for playing SoundTracker-style music files
    modules - Build the kernel modules
    +modules-compress - Install compressed kernel modules (if kernel config enables module compression)
    modules-sign - Cryptographically sign installed kernel modules (requires CONFIG_MODULE_SIG=y in the kernel)
    mono - Build Mono bindings to support dotnet type stuff
    motif - Add support for the Motif toolkit
    --
    2.43.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Dec 28 11:40:01 2023
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/kernel-build.eclass | 4 ++--
    eclass/kernel-install.eclass | 6 +++---
    2 files changed, 5 insertions(+), 5 deletions(-)

    diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
    index 29ee9f86e7e2..28f111ec998b 100644
    --- a/eclass/kernel-build.eclass
    +++ b/eclass/kernel-build.eclass
    @@ -284,7 +284,7 @@ kernel-build_src_install() {
    dostrip -x /lib/modules

    local compress=()
    - if [[ ${KERNEL_IUSE_GENERIC_UKI} ]] && ! use module-compress; then
    + if [[ ${KERNEL_IUSE_GENERIC_UKI} ]] && ! use modules-compress; then
    compress+=(
    # force installing uncompressed modules even if compression
    # is enabled via config
    @@ -560,7 +560,7 @@ kernel-build_merge_configs() {

    # Only semi-related but let's use that to avoid changing stable ebuilds.
    if [[ ${KERNEL_IUSE_GENERIC_UKI} ]]; then
    - # NB: we enable this even with USE=-module-compress, in order
    + # NB: we enable this even with USE=-modules-compress, in order
    # to support both uncompressed and compress
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Dec 28 11:40:01 2023
    Add a `modules-compress` USE flag to explicitly control kernel module compression. When the flag is disabled, modules are installed
    uncompressed even if the kernel supports compression (which is going
    to be the case for new sys-kernel/gentoo-kernel* builds). When it is
    enabled, the eclass compresses modules using the compressor configured,
    or fails if no compression is supported.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/linux-mod-r1.eclass | 14 ++++++++------
    1 file changed, 8 insertions(+), 6 deletions(-)

    diff --git a/eclass/linux-mod-r1.eclass b/eclass/linux-mod-r1.eclass
    index 44fc927c3a70..54df2406e5c7 100644
    --- a/eclass/linux-mod-r1.eclass
    +++ b/eclass/linux-mod-r1.eclass
    @@ -111,7 +111,7 @@ _LINUX_MOD_R1_ECLASS=1

    inherit edo linux-info multiprocessing toolchain-funcs

    -IUSE="dist-kernel modules-sign +strip ${MODULES_OPTIONAL_IUSE}" +IUSE="dist-kernel modules-compress modules-sign +strip ${MODULES_OPTIONAL_IUSE}"

    RDEPEND="
    sys-apps/kmod[tools]
    @@ -835,6 +835,8 @@ _modules_prepare_toolchain() {
    # If enabled in the kernel configuration, this compresses the given
    # modules using the same format.
    _modules_process_compress() {
    + use modules-compress || return
    +
    local -a compress
    if linux_chkconfig_present MODULE_COMPRESS_XZ; then
    compress=(
    @@ -853,13 +855,13 @@ _modules_process_compress() {
    fi
    elif linux_chkconfig_present MODULE_COMPRESS_ZSTD; then
    compress