Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framebuffer can not be disabled in GRUB/UEFI mode #238

Open
jkirk opened this issue Dec 19, 2024 · 9 comments
Open

Framebuffer can not be disabled in GRUB/UEFI mode #238

jkirk opened this issue Dec 19, 2024 · 9 comments
Assignees

Comments

@jkirk
Copy link
Contributor

jkirk commented Dec 19, 2024

In our GRUB configuration we have set gfxmode=auto, see:

The gfxmode documentation states that a platform-specific default "that should look reasonable" is selected as resolution (via VESA BIOS Extensions (VBE)).
For instance, in my QEMU instance a resolution of 1280x800 is selected by the GRUB boot menu.

It seems that once the resolutions has changed the framebuffer can not be disabled with the boot options.
Here the following boot options do not seem to work:

  • "Disable Framebuffer"
  • "Disable Video Kernel Mode Setting"

We should consider dropping them in the GRUB/UEFI boot menu (see below).

Note, that "Disable Framebuffer" (and "Serial Console") in Grub sets set gfxpayload=text. All other options have set gfxpayload=keep, see: %SHORT_NAME%_options.cfg

Quoting the gfxpayload documentation:

If this variable is set, it controls the video mode in which the Linux kernel starts up, replacing the ‘vga=’ boot option (see linux). It may be set to ‘text’ to force the Linux kernel to boot in normal text mode, ‘keep’ to preserve the graphics mode set using ‘gfxmode’, or any of the permitted values for ‘gfxmode’ to set a particular graphics mode (see gfxmode).

This means that set gfxpayload=text should actually work (with "Disable Framebuffer" ), but it does not...

Further:

Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this variable to ‘text’ and GRUB will tell Linux to boot in normal text mode.

As far as I can tell, we have no display problems, but we can not change back to text mode.
But again, we have gfxmode set. Maybe we should test without it?

The default is platform-specific. On platforms with a native text mode (such as PC BIOS platforms), the default is ‘text’. Otherwise the default may be ‘auto’ or a specific video mode.

sigh This makes it hard to test. I guess we use GRUB primarily with UEFI platforms. For BIOS platforms we use isolinux/syslinux. This means we just need to answer the question if we want UEFI systems to be able to boot in text mode or alike or drop everything regarding framebuffer / resolution and only keep the auto detection process.

@jkirk
Copy link
Contributor Author

jkirk commented Dec 19, 2024

I think I already mentioned it somewhere (in grml/grml#9 and elsewhere), but we should investigate some more kernel parameters:

  • video=vesafb:off
  • video=efifb:off

Some links on this:

@jkirk jkirk self-assigned this Feb 10, 2025
@jkirk
Copy link
Contributor Author

jkirk commented Feb 10, 2025

Via @zeha
https://source.mnt.re/reform/reform-rk3588-uboot/-/blob/main/mnt-pocket-reform-rk3588_defconfig?ref_type=heads#L70

CONFIG_BOOTARGS="clk_ignore_unused cma=256M swiotlb=65535 fbcon=rotate:3 fbcon=font:TER16x32"

@mika
Copy link
Member

mika commented Feb 14, 2025

I can confirm that fbcon=font:TER16x32 works nicely for the kernel part, thanks @jkirk + @zeha. But then later on in our boot process we're switching to our default and hardcoded font settings that are configured via console-setup.

Now that the console-setup was moved from grml-autoconfig (see grml/grml-autoconfig@4be463b + grml/grml-autoconfig@4f89bd4) towards grml-live's config/scripts/GRMLBASE/26-console-setup, what could we do to properly control this (as in: if one boots with fbcon=font:TER16x32 we don't override/modify it during booting)? 🤔

@zeha
Copy link
Member

zeha commented Feb 14, 2025

what could we do to properly control this (as in: if one boots with fbcon=font:TER16x32 we don't override/modify it during booting)? 🤔

Maybe we want to disable console-setup completely and pick a font for the default boot menu entry.

@mika
Copy link
Member

mika commented Feb 14, 2025

what could we do to properly control this (as in: if one boots with fbcon=font:TER16x32 we don't override/modify it during booting)? 🤔

Maybe we want to disable console-setup completely and pick a font for the default boot menu entry.

Oh, nice idea, I like it! 👍 🙇

@jkirk
Copy link
Contributor Author

jkirk commented Feb 20, 2025

I have a HP Elite x2 1012 G2 with a quite unusual HiDPI display resolution of 2736x1824.
I booted grml-full-daily20250217build238unstable-amd64.iso via Ventoy and from an USB Stick made with grml2usb and played around with a few options.

After a few hours of research and digging in the rabbit role, there are quite a few things to untangle:

Because you (@mika) used fbcon successfully, I took a closer look into the fbcon documentation, quoting a few sections:

A common bug report is enabling the framebuffer without enabling the framebuffer console. Depending on the driver, you may get a blanked or garbled display, but the system still boots to completion. If you are fortunate to have a driver that does not alter the graphics chip, then you will still get a VGA console.

Boot options: The framebuffer console has several, largely unknown, boot options that can change its behavior.

The fbdev drivers cannot be unloaded if bound to fbcon, and fbcon cannot be unloaded if it’s bound to the console layer.

Anyway, that is a lot to digest. Maybe we can discuss, what we want / expect and what we do not want.

@jkirk
Copy link
Contributor Author

jkirk commented Feb 24, 2025

Decision from our meeting with @zeha + @mika (not all of the following to be handled in this issue):

  • Drop "disable framebuffer" boot options (i.e. "Disable Framebuffer" + "Disable Video Kernel Mode Setting") from GRUB/UEFI boot menu
  • Implement kernel options to set font + resolution early in the boot process to be consistent with what we get with console-setup
  • Add a boot option for "large fonts"
  • We want to be able to change font and/or the resolution after boot (add fbset + keep console-setup)
  • We currently have not plans on supporting GPU passthrough. Ignoring for now
  • Make sure grml-x looks "good" on high resolution displays
  • We talked about moving away from X to wayland and switch the kind of obsolete window manager fluxbox. Some things we talked about:

@jkirk
Copy link
Contributor Author

jkirk commented Feb 24, 2025

Some more infos + things I need to investigate:

@jkirk
Copy link
Contributor Author

jkirk commented Feb 25, 2025

Addendum:

journalctl -k | grep efifb looks like this on my system after a normal boot:

Feb 24 14:47:45 grml kernel: efifb: probing for efifb
Feb 24 14:47:45 grml kernel: efifb: framebuffer at 0x1fc0000000, using 19496k, total 19494k
Feb 24 14:47:45 grml kernel: efifb: mode is 2736x1824x32, linelength=10944, pages=1
Feb 24 14:47:45 grml kernel: efifb: scrolling: redraw
Feb 24 14:47:45 grml kernel: efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0

When booting with video=efifb:off neither efifb nor framebuffer is mentioned in the logs:

Feb 25 15:30:53 grml kernel: Command line: BOOT_IMAGE=/boot/grmlfullamd64/vmlinuz apm=power-off boot=live findiso= nomce net.ifnames=0 live-media-path=/live/grml-full-amd64/ bootid=5cfce929-828c-402d-b1f3-e802c421e3a0 video=efifb:off
Feb 25 15:30:53 grml kernel: Kernel command line: BOOT_IMAGE=/boot/grmlfullamd64/vmlinuz apm=power-off boot=live findiso= nomce net.ifnames=0 live-media-path=/live/grml-full-amd64/ bootid=5cfce929-828c-402d-b1f3-e802c421e3a0 video=efifb:off

But I still get a (the same looking) high resolution console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants