Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 904694 - kernel-build.eclass: install fails if config contains CONFIG_MODULES=n
Summary: kernel-build.eclass: install fails if config contains CONFIG_MODULES=n
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Distribution Kernel Project
URL:
Whiteboard:
Keywords: NeedPatch, PullRequest
Depends on:
Blocks:
 
Reported: 2023-04-20 04:55 UTC by Boris Staletic
Modified: 2023-08-20 15:46 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Staletic 2023-04-20 04:55:47 UTC
Currently kernel-build.eclass assumes `make modules_install` is valid in two places.
However, on kernels built with CONFIG_MODULES=n that fails with the following error:

>>> Install sys-kernel/gentoo-kernel-6.2.11 into /var/tmp/portage/sys-kernel/gentoo-kernel-6.2.11/image
make -j5 O=/var/tmp/portage/sys-kernel/gentoo-kernel-6.2.11/work/build V=1 HOSTCC=x86_64-pc-linux-gnu-gcc HOSTCXX=x86_64-pc-linux-gnu-g++ 'HOSTCFLAGS=-O3 -march=native -pipe' 'HOSTLDFLAGS=-Wl,-O1 -Wl,--as-needed' CROSS_COMPILE=x86_64-pc-linux-gnu- AS=x86_64-pc-linux-gnu-as CC=x86_64-pc-linux-gnu-gcc LD=x86_64-pc-linux-gnu-ld.bfd AR=x86_64-pc-linux-gnu-ar NM=x86_64-pc-linux-gnu-nm STRIP=: OBJCOPY=x86_64-pc-linux-gnu-objcopy OBJDUMP=x86_64-pc-linux-gnu-objdump ARCH=x86 INSTALL_MOD_PATH=/var/tmp/portage/sys-kernel/gentoo-kernel-6.2.11/image INSTALL_PATH=/var/tmp/portage/sys-kernel/gentoo-kernel-6.2.11/image/boot modules_install
make -C /var/tmp/portage/sys-kernel/gentoo-kernel-6.2.11/work/build -f /var/tmp/portage/sys-kernel/gentoo-kernel-6.2.11/work/linux-6.2/Makefile modules_install
***
*** The present kernel configuration has modules disabled.
*** To use the module feature, please run "make menuconfig" etc.
*** to enable CONFIG_MODULES.
***
make[1]: *** [/var/tmp/portage/sys-kernel/gentoo-kernel-6.2.11/work/linux-6.2/Makefile:1964: modules_install] Error 1
make: *** [Makefile:242: __sub-make] Error 2

Now, I am not sure what the right course of action here is, as the eclass
intentionally does not use `make install`.
`make bzImage` does exist, but `make help` says that is architecture specific.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-04-23 03:12:14 UTC
I'm sorry but support for uncommon custom configs means you need to supply a patch.
Comment 2 Boris Staletic 2023-04-23 06:24:56 UTC
That sounds absolutely fair. I have a patch locally, but have not had a chance to try it yet.

Should the patch be submitted over at https://github.com/gentoo/gentoo ?
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-04-23 17:32:01 UTC
(In reply to Boris Staletic from comment #2)
> That sounds absolutely fair. I have a patch locally, but have not had a
> chance to try it yet.
> 
> Should the patch be submitted over at https://github.com/gentoo/gentoo ?

Yeah, preferably there.  If you don't want to use GH, you can also git-send-email it to us.
Comment 4 Larry the Git Cow gentoo-dev 2023-08-20 15:46:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bcfd48957adc57003821b6801eac84a46139298b

commit bcfd48957adc57003821b6801eac84a46139298b
Author:     Boris Staletic <boris.staletic@protonmail.com>
AuthorDate: 2023-08-17 17:05:40 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2023-08-20 15:46:45 +0000

    kernel-build.class: Allow usage with module-less kernel configs
    
    With CONFIG_MODULES not set to either y or m, kernel-build.eclass runs
    into two issues:
    
    1. Modules.symvers does not get generated. doins build/Module.symvers
       thus fails.
    2. kernel.release exists,
       but in ${WORKDIR}/build/include/config/kernel.release
       while kernel-build_src_install() seems to expect to to find it
       in ${PWD}/include/config.
    
    Closes: https://bugs.gentoo.org/904694
    Signed-off-by: Boris Staletic <boris.staletic@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/32358
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 eclass/kernel-build.eclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)