feat(systemd): pull 'drm' module unless excluded#1982
feat(systemd): pull 'drm' module unless excluded#1982pvalena wants to merge 2 commits intodracut-ng:mainfrom
Conversation
|
This PR seem to cause regression for If dracut introducea a dependency on the drm module, is the systemd dracut module the best place to do so ? Why not Also how does this relates to the work on the simpledrm dracut module ? What if user adds simpledrm dracut module to the configuration ? |
|
Sure, makes sense, as console fonts are set/loaded via i18n, lets move it there. I will refresh this PR. The failures / timeouts for ubuntu:devel seem to be however somewhat unrelated :) (or in the very least it's strange that this change would introduce a breakage, as drm is just loading some kernel modules). |
Head branch was pushed to by a user without write access
|
@LaszloGombos @Conan-Kudo PTAL. |
|
Same question as Laszlo: How does this relates to the work on the simpledrm dracut module? |
@pvalena please see https://github.com/dracut-ng/dracut-ng/blob/main/modules.d/45plymouth/module-setup.sh#L48 for reference |
|
I don't think it's related -- they're simply different drivers. I do not know if/how they interoperate, but I'd suppose DRM takes precedence over SimpleDRM, since it utilizes the accelerated rendering (and simpledrm is just a kernel fallback). I don't have any HW currently to test it, however. Maybe @rmetrich will know? WRT the plymouth question, this configuration assumes plymouth is not available on the system, so I'd say we can't know. And since it's only for better font support, I don't think it matters. We can however have a conditional (inverse) depends based on whether simpledrm module is added. |
This is an established patter - see e.g. https://github.com/dracut-ng/dracut-ng/blob/main/modules.d/11systemd-udevd/module-setup.sh#L27 |
Is this true even if you end up later loading e.g. NVIDIA drivers ? |
|
Title of the commit message needs to be fixed
|
I think that's however a different logic. We probably want EDIT: In addition we could use this logic as well, although I don't know whether simpledrm does support the font rendering, which is what we want (we'd need to test). More importantly, IIUC, the plymouths |
|
Plymouth module might pull in simpledrm module, and at the same time this module might pull in the drm module - so both simpledrm and drm is pulled in since I am wondering if this is why test 70,71 is failing on ubuntu:devel. |
You're right, I was unsure how else to resolve it, and didn't want to introduce several changes at once. Would it then make sense to load plymouth module earlier? |
Since I am just guessing, best to comfirm the issue before trying to solve it. If it is indeed the issue, than I would order i18n after plymouth - maybe like 46i18n ? |
|
@LaszloGombos PTAL. |
| for _module in "${_modules[@]}"; do | ||
| if dracut_module_included "$_module"; then | ||
| _drm="$_module" | ||
| break | ||
| fi | ||
| done | ||
|
|
||
| if [[ -z $_drm ]]; then | ||
| for _module in "${_modules[@]}"; do | ||
| module_check "$_module" > /dev/null 2>&1 | ||
| if [[ $? == 255 ]] && ! [[ " $omit_dracutmodules " == *\ $_module\ * ]]; then | ||
| _drm="$_module" | ||
| break | ||
| fi | ||
| done | ||
| fi |
There was a problem hiding this comment.
The whole logic looks identical to other modules like 40network. Maybe we should add a helper function to dracut-functions.sh for that.
There was a problem hiding this comment.
Can we do refactoring in other PR?
First hit when I do a search for "simpledrm" and "Fedora" https://fedoraproject.org/wiki/Changes/PlymouthUseSimpledrm I would think Fedora should care about simpledrm just as much as any other major distro.
Similar sentiment as I pointed out at #1982 (comment) CC @jwrdegoede |
It's not that I wouldn't know what it is, but rather whether it actually uses the fonts -- without plymouth (situation this PR is trying to address). But I can simply assume they do as well :).
ditto; this PR is not about plymouth |
Some graphic cards require the 'drm' module to be present to be able to setup the console font (e.g. 'i915' requires it). Also avoid conflicts of 'drm' with 'simpledrm' module. Signed-off-by: Renaud Métrich <rmetrich@redhat.com> Co-authored-by: Renaud Métrich <rmetrich@redhat.com>
i18n module loads different drm module based on what is already loaded, but plymouth module decides which drm to load based on config files - therefore plymouth needs to load before i18n.
|
|
A couple of remarks here:
I can see a couple of reasons why font-setting would not work without the i915 driver loaded:
I expect this to be the most likely root-cause. The upstream kernel has recently grown support for running simpledrm over vesa for this setup and IMHO the correct fix would be to move towards using that, which means running the latest kernel with the right Kconfig. If someone wants to look into enabling this for their distro I suggest reaching out to Thomas Zimmermann tzimmermann@suse.de who did all the kernel work for this. I believe this is likely all in place in 6.18.
Note deferred-fbcon-takeover takes over the console from dummycon as soon as the first character is printed to the console. So unless you're booting with "quiet" and your userspace is also fully quiet before the i18n module does the console setup this will not be the problem. |
|
One more possible root-cause, already mentioned above
Rereading the original PR description. I'm even more confused about the root-cause there. The drm module itself is mostly a "library" module, that is it provides functionality to other drivers. Is the i915 drm/kms driver already in the initrd and is the drm module somehow not being brought in, that would be a bug in dracut's kernel-module dependency resolution. This feels to me that like instead of a PR, this needs a proper bug report with logs (e.g. dmesg output) of both the working and non-working cases. Also it would be good to try and manually set the font from the cmdline in the non-working case to rule out a race/timing issue as the root cause. Then once we understand what the problem is we can start looking into fixing this. |
Great! Thanks for the confirmation it works as expected. Like I said in my earlier comment, the order doesn't really matter, so it can be reversed if that is benefitial.
I don't understand how this is relevant -- i915 is nowhere mentioned? (i18n is something completely different) (Skipping the rest for now, as I need this answered first.) |
|
On 9-Feb-26 18:50, Pavel Valena wrote:
I don't understand how this is relevant -- i915 is nowhere mentioned? (i18n is something completely different)
(Skipping the rest for now, as I need this answered first.)
Just having the drm module in the initrd by itself should not do anything.
As mentioned in my previous comments the drm module is mostly a library module
providing helper functions for drm drivers. So you also need an actual drm
driver (e.g. i915 or simpledrm) in the initrd for the mere act of just adding
the drm module to the initrd to make a difference.
|
|
Let me rephrase things a bit. If you run lsinitrd on the generated initrd both before and after the suggested changes like this: What changes does the diff command show, or in other words which extra files get added to the initrd? In your original description you sorta claim that only the |
|
Diff: https://gist.github.com/pvalena/5ae5dca31b5410d89a377febfc612937 Note: It's run on my VM which is a clone of my previous fedora-rawhide laptop (workstation) installation :). (Sorry for sending it multiple times, there was a github outage, and it just timed out for me every time -- but it did get to some queue...) |
Firstly, I'm sorry, but the description was copied from the original 1-line PR. I have made some changes since, but the idea is the same; added dependency in between dracut modules. Also, I'm not aware that it actually says it adds only the drm module exclusively, but, more importantly: here module = dracut module; which also pulls dependencies (modules, binaries, and various files it might as well; recursively; if needed). |
I do not think the drm dracut module pulls in any (non-kernel) binary. This is also what seems to be in your logs - only additional kernel modules. Also it does not seem to pull in any other dracut module. |
From the git commit message of this PR:
If 'i915' requires it, would that mean that |
I was refering to the dracut module concept in general (only if that specific module needs it), not to this specific case. Just as an examle to illustrate what dracut module is.
Right, I'm afraid I also copied the commit message as well. Let me ping the original author for comment on this specific example -- @rmetrich PTAL. (Note: I think he's currently unavailable and will respond in 2-3 weeks) |
|
I just want to point out that this PR already landed in the RHEL-10 repo - redhat-plumbers/dracut-rhel10#59 . I wonder how it was tested and reviewed before merging into product branch (and before landing it upstream). |
To clarify: yes, this was merged, and is being tested internally as now :) nothing landed yet. Thank you for the interest in our processes. |
Thanks for the clarification. Can you share the result of this testing to help with the upstream PR review ? |
|
|
AFAICT this would pull in the drm and simpledrm modules even if plymouth is not installed? IMO that's a major regression in initrd size, as it will pull in all kinds of DRM modules and GPU firmware by default that way. |
Potentially relevant: #2362 (comment) |
Thank you for providing this and sorry for being slow to respond. So what is new here is the addition of the bochs.ko kernel module. I was confused before because when you mentioned adding the drm module I though you mentioned adding the drm.ko kernel module (which appears to be builtin on your kernel), but I now see you meant the drm dracut module. In cases where there can be confusion like this please fully spell out "dracut module" when talking about a dracut module. So it seems that loading the bochs drm kernel module which will use fbcon as console, likely replacing vgacon, makes things work. This suggests that you are using a font which is not compatible with vgacon. So a less invasive fix would be to select a font which is compatible with vgacon. An alternative fix would be to use the new vesa drivers/gpu/drm/sysfb/vesadrm.c driver which is a drm driver for vesa framebuffers and the bochs compatible VGA card in your vm should support a vesa framebuffer. This will give you fbcon over the vesadrm fb which should be just as compatible as doing this through the bochs drm driver without requiring the addition of drm kernel modules to the initramfs. IMHO adding drm kernel modules to the base initramfs without plymouth as this PR does is not acceptable since for non-hostonly / generic initramfs builds this will make the initramfs absolutely huge since the amdgpu and especially the nova drm drivers require huge firmwares to get added to the initramfs. Also all in all I still miss the following here:
|
This is a clone of PR dracutdevs/dracut#2719 by @rmetrich
Changes
Some graphic cards require the 'drm' module to be present to be able to setup the console font (e.g. 'i915' requires it).
Checklist