Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 744643 - sys-kernel/genkernel-4.1.2-r3: option --module-rebuild doesn’t call "emerge […] @module-rebuild" (--install required?)
Summary: sys-kernel/genkernel-4.1.2-r3: option --module-rebuild doesn’t call "emerge [...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-25 13:34 UTC by Thibaud CANALE
Modified: 2020-09-25 16:07 UTC (History)
0 users

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


Attachments
genkernel.log (gzip) (genkernel.log.gz,79.55 KB, application/gzip)
2020-09-25 13:34 UTC, Thibaud CANALE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thibaud CANALE 2020-09-25 13:34:34 UTC
Created attachment 662371 [details]
genkernel.log (gzip)

Hello,

While using genkernel with option "--module-rebuild", the tool didn’t call "emerge […] @module-rebuild" when all the conditions wrote in the genkernel(8) man page are met:
>        --[no-]module-rebuild
>            Runs, or does not run "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild" to build out-of-tree modules when possible, i.e. when non-static kernel and modules will be build, installed, --kernel-modules-prefix is not set, /var/lib/module-rebuild/moduledb exists and is not empty.

From its log, /var/log/genkernel.log (see attachment):
> *   KERNEL_MODULES_PREFIX not set.
> *   MODULEREBUILD set on command line to "yes".
> *   MODULEREBUILD_CMD defaulted to "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild".

And /var/lib/module-rebuild/moduledb exists and is not empty:
> % cat /var/lib/module-rebuild/moduledb
> a:1:app-emulation/virtualbox-modules-6.1.14
> a:1:x11-drivers/nvidia-drivers-450.66

The command line used:
> genkernel --makeopts='-j16' --no-clean --no-mrproper --no-install --no-symlink --no-all-ramdisk-modules --module-rebuild --kernel-config=/usr/src/linux/.config --no-splash --busybox --no-ssh --mdadm --mdadm-config=/root/boot_template/mdadm_root.conf --no-dmraid --gpg --luks --lvm --microcode=amd --firmware --strip=all all

I still think there is a case where emerge didn’t get called it’s because I called "no-install" to avoid installing the kernel in /boot, which I don’t want because the kernel’s and initramfs’ names are not what I want (the option KERNEL_FILENAME and INITRAMFS_FILENAME are not respected, but this is another bug).
Also, the option "--[no-]install" talks about "install[ing] the kernel to /boot after building." but nothing about the modules, which I do on my own "make modules_install" after genkernel’s success.

Thanks for support.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2020-09-25 14:55:47 UTC
Genkernel output is pretty clear, not?

> *         >> --no-install set; Skipping 'emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild' ...

Also from quoted man page:

>        --[no-]module-rebuild
>            Runs, or does not run "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild"
>            to build out-of-tree modules when possible, i.e. when non-static kernel and modules will be build, installed,
>                                         ^^^^^^^^^^^^^                              ^^^^^^^^^^^^^^^^^^^        ^^^^^^^^^^    
>            --kernel-modules-prefix is not set, /var/lib/module-rebuild/moduledb exists and is not empty.

Problem is that emerge cannot build for non-installed kernels.


> Also, the option "--[no-]install" talks about "install[ing] the kernel to /boot after building."
> but nothing about the modules, which I do on my own "make modules_install" after genkernel’s success.

Don't do that. You are getting it wrong. Installing kernel also includes doing /lib/modules...

If you use genkernel to create kernel, you shouldn't touch kernel manually and doing anything manually will cause trouble.
Comment 2 Thibaud CANALE 2020-09-25 16:07:40 UTC
(In reply to Thomas Deutschmann from comment #1)
> Genkernel output is pretty clear, not?
> 
> > *         >> --no-install set; Skipping 'emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild' ...

My bad, I didn’t see it. It could be displayed on stdin too.
It’s just a game of puzzle and threads to understand the genkernel options and some of its implications.
I think some options should have explicit messages in its man page about "requires --X option" or "will be skipped if option --Y".

> Problem is that emerge cannot build for non-installed kernels.

I always managed to build modules (emerge @module-rebuild) for non-installed kernels, because I execute it before rebooting to avoid loosing service and then time.

> > Also, the option "--[no-]install" talks about "install[ing] the kernel to /boot after building."
> > but nothing about the modules, which I do on my own "make modules_install" after genkernel’s success.
> 
> Don't do that. You are getting it wrong. Installing kernel also includes
> doing /lib/modules...

I really don’t understand what means "installing kernel", because its path depends on too many ways to boot it from different bootloaders.

> If you use genkernel to create kernel, you shouldn't touch kernel manually
> and doing anything manually will cause trouble.

At least 7 years I move it manually (was recently still using extlinux before moving to systemd-boot for UEFI support), never had trouble.
Still have no idea where genkernel wants to "install" the kernel and its initramfs.