Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 928271 - x11-drivers/nvidia-drivers[dist-kernel] don't rebuild initramfs
Summary: x11-drivers/nvidia-drivers[dist-kernel] don't rebuild initramfs
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Ionen Wolkens
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-03-30 19:46 UTC by nE0sIghT
Modified: 2024-05-17 18:57 UTC (History)
4 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 nE0sIghT 2024-03-30 19:46:03 UTC
Newer `x11-drivers/nvidia-drivers` now provides fbdev support however nvidia kernel modules should be available at early boot for this to work according to [1].
It would be nice if ebuild will include `dist-kernel_reinstall_initramfs` call in case `dist-kernel` USE flag is used.

[1] https://wiki.archlinux.org/title/Talk:NVIDIA#Framebuffer_consoles_experimental_support
Comment 1 Ionen Wolkens gentoo-dev 2024-03-30 20:03:21 UTC
Personally don't think its fbdev support is useful for initramfs early boot when something else like SIMPLEDRM can do the job and will be more reliable (nvidia's fbdev should have the perk of being able to replace a loaded simpledrm or even nouveau which is greatly why nvidia has implemented it, not that I experimented with that much -- otherwise would have to use simplefb/efifb).

Plus including nvidia modules on initramfs has a tendency to easily end up in mismatch when anything goes wrong (they are also massive, expect like +50-100MB to the initramfs including the gsp firmwares).

It would also need to setup additional configuration given dracut skips nvidia + its firmwares by default last I know of.
Comment 2 Ionen Wolkens gentoo-dev 2024-03-30 20:15:18 UTC
I think the USE would also be confusing for users, do not really want to encourage use of experimental fbdev=1 at the moment and is useless to include without it.
Comment 3 nE0sIghT 2024-03-31 08:33:52 UTC
Ionen, thanks for quick reply! I understand your rationale so fill free to close this as WONTFIX.

In case someone will be interested I succesfuly tested nvidia fbdev.
I'm still unsure whether nvidia modules should be included in the initramfs. In my case fb (and efifb) was compilled in the kernel so nvidia fbdev threw error. After disabling efifb (it can not be compilled as a module) and reconfiguring fb as module nvidia fbdev works fine.

Nvidia fbdev works fine for me as efifb. However with efifb I getting immediate console output at the boot in contrast to nvidia fbdev. There is also flickering when switching from GNOME X11 session to console with nvidia fbdev which is same with efifb (I hoped it will not be issue with nvidia fbdev).


Here is my configuration for including nvidia modules to initramfs with dist-kernel (and auto-rebuild initramfs on nvidia modules recompile):
/etc/dracut.conf.d/nvidia.conf:
```
hostonly="yes"

add_drivers+=" nvidia-drm nvidia-modeset nvidia-peermem nvidia-uvm nvidia "
install_items+=" /lib/firmware/nvidia "

mdadmconf="yes"
lvmconf="yes
```

/etc/portage/env/x11-drivers/nvidia-drivers:
```
post_pkg_postinst() {
	if [[ -z ${ROOT} ]] && use dist-kernel; then
		dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
	fi
}
```
Comment 4 Ionen Wolkens gentoo-dev 2024-03-31 11:47:05 UTC
(In reply to nE0sIghT from comment #3)
> Ionen, thanks for quick reply! I understand your rationale so fill free to
> close this as WONTFIX.
Alright, will do that for now. Not to say entirely closed to revisiting this eventually. Ideally we'll eventually have a better way to schedule building the initramfs though then this may never be needed, zfs-kmod's postinst method has the downside of rebuilding it twice for gentoo-kernel[initramfs]
Comment 5 Larry the Git Cow gentoo-dev 2024-05-17 12:07:30 UTC
The bug has been referenced in the following commit(s):

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

commit f439b4ec05b1982f06f67fbf39a46ae0db187a76
Author:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
AuthorDate: 2024-05-08 06:02:53 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
CommitDate: 2024-05-17 12:06:42 +0000

    linux-mod-r1.eclass: add USE=initramfs
    
    Adds a new variable that adds the "initramfs" flag when set. This new
    flag controls whether or not the modules that were built should be
    included in the initramfs. If the modules should be included, then we
    also rebuild the initramfs/uki in post_install using installkernel.
    
    Bug: https://bugs.gentoo.org/923025
    Bug: https://bugs.gentoo.org/928271
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>

 eclass/linux-mod-r1.eclass | 54 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)