Grub2-mkconfig not changing resolution but yast2-bootloader does in 15.1

I have been struggling with an issue that I did not have with openSUSE 42.3.

I built a custom image with Kiwi, and after install, GRUB’s resolution is in 800x600. If I edit /etc/default/grub and change it to the native resolution of 800x1280 and run:

grub2-mkconfig -o /boot/efi/EFI/BOOT/grub.cfg

Nothing changes. I know this is the correct grub.cfg since I can manually edit it and make my changes appear in GRUB.

I can then install the yast2-bootloader and it will pick up the 800x1280 resolution in my /etc/default/grub and if I save and reboot, the resolution in GRUB is correct. Yast2-bootloader seems to move things around and make a new directory under /boot/efi/EFI/themename with a grub.cfg that points to the original grub.cfg. Yast2-bootloader also install some other packages before changing anything, kexec-tools, and mokutils, and it also seems to rebuild the initrd. Basically I want to do what yast is doing without using yast.

This all worked in 42.3. In fact, on a fresh install of 15.1, if I copy over the grub.efi file from 42.3, GRUB’s resolution will be correct, which makes me think it is not a grub.cfg problem, but rather a grub.efi issue.

I am using grub for efi, and shim for Secure Boot if that makes a difference, which were all part of my 42.3 install as well.

If someone could help it would be greatly appreciated, as I’ve spent a lot of time on this and would like it wrapped up. If I need more info, please let me know.

It is not clear what you are doing.

The normal place for “grub.cfg” is “/boot/grub2”. However, since you have a custom image, it’s hard to know what’s appropriate for that custom system.

Two questions:

1: What’s the output from

efibootmgr -v

2: What’s the output from

/boot/efi/EFI/BOOT

Hello and thank you for answering.

I agree that the normal place for grub.cfg is in /boot/grub2, and I think it’s a Kiwi thing to place it in /boot/efi/EFI/BOOT/. Here’s the output of efibootmgr -v on a fresh install without messing with yast bootloader:

SYSTEM:~ # efibootmgr -v
BootCurrent: 004D
Timeout: 1 seconds
BootOrder: 004D,003B,004B
Boot003B* UEFI: IP4 Realtek USB FE Family Controller    PciRoot(0x0)/Pci(0x14,0x0)/USB(3,0)/USB(2,0)/USB(2,0)/USB(0,0)/MAC(00e04c37bae3,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot004B* Android-IA    VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot004D* Android-IA    HD(2,GPT,09723d58-332f-45a3-838c-b5c695dfda69,0x1800,0xa000)/File(\EFI\BOOT\BOOTX64.EFI)

And correct me if I’m wrong, but that bootx64.efi could be part of my problem? Isn’t that some sort of fallback/default bootloader?

And by “output of /boot/efi/EFI/BOOT,” do you mean the directory contents?

SYSTEM:~ # ls -al /boot/efi/EFI/BOOT/
total 3364
drwxr-xr-x 2 root root    2048 May 19 04:43 .
drwxr-xr-x 3 root root    2048 May 19 04:42 ..
-rwxr-xr-x 1 root root 1158688 May 19 04:43 MokManager.efi
-rwxr-xr-x 1 root root 1208968 May 19 04:43 bootx64.efi
-rwxr-xr-x 1 root root    7959 May 20 16:21 grub.cfg
-rwxr-xr-x 1 root root 1062752 May 19 04:43 grub.efi

I have not used Kiwi myself. However, what you show there is similar to what I see on an install iso or live iso, and building those does use iso.

So I’m looking there for guidance.

The provided “grub.cfg” sets $prefix to be used by grub. Relative to the DVD file system on an iso, it seems to set $prefix to “/boot/x86_64/grub2-efi”. And the grub.cfg will be using the themes defined under that directory.

When you use Yast, it is probably installing grub2-efi somewhere else, and using the themes that it installs.

I’m guessing that it is the change in themes that is related to your problems.

If you want full control over grub, you probably need to reinstall grub (i.e. grub2-efi) instead of relying on what was built into the kiwi image. And I’m guessing that Yast is doing what you want because it is reinstalling grub.

To my experience grub does everything right by default. When installing I watch for the following:

  • Set GRUB_DISTRIBUTOR All openSUSE distributions use ‘opensuse’ as default, which can cause problems when installing two or more systems.
  • Turn off secure boot. There is no good point for turning it on.

I don’t touch settings related to graphics:

erlangen:~ # grep -v \# /etc/default/grub|grep -v ^\$
GRUB_DISTRIBUTOR=Tumbleweed-btrfs
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=3
GRUB_CMDLINE_LINUX_DEFAULT="splash=silent mitigations=auto"
GRUB_CMDLINE_LINUX=""
GRUB_TERMINAL="gfxterm"
GRUB_GFXMODE="auto"
GRUB_BACKGROUND=
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
SUSE_BTRFS_SNAPSHOT_BOOTING="true"
GRUB_USE_LINUXEFI="true"
GRUB_DISABLE_OS_PROBER="true"
GRUB_ENABLE_CRYPTODISK="n"
GRUB_CMDLINE_XEN_DEFAULT="vga=gfx-1024x768x16"
erlangen:~ # 

You did not provide any factual information at all. Neither what you changed, nor content of new grub.cfg. So it is impossible to guess why your change did not work.