So, recently had to mess with grub2-efi because for some reason the bootloader got stuck with kernel 6.14.6-1-default, this is because every time after a distro upgrade or me using grub2-mkconfig this error always appear "insmod: ERROR: could not load module part_gpt: No such file or directory",
no matter what, force-reinstalling the grub2, grub2-x86_64-efi, and grub2-branding-openSUSE packages always gave me the same error, as an ultimatum, had to rename /etc/default/grub to just grub.old and rerun grub2-mkconfig and worked, now i’m in the latest kernel 7.0.12-default, unfortunately the openSUSE charm of GRUB2 theme, is gone and it just the plain old boring stock one, i’ve tried to restore it but no luck.
Note i have running OpenSUSE with secure-boot enabled in my motherboard (Asus X79), had to roll MOK keys but no issues whatsover beyond the boring GRUB2 looks, i’ve read secure-boot disables any insmod calls unfortunately, not sure why, but i swear i had secure-boot enabled long before this became an issue.
The easiest fix (with Tumbleweed) is to use Yast Bootloader. Just change something, such as increase the timeout by 1 second. The Yast should reconfigure grub2 for you.
This is true. But most of the needed insmod calls have been built into the “grub.efi” that is in your EFI partition.
Already tried YasT Bootloader, it gives this warning (because /etc/default/grub being absent), restoring the old default grub file will cause a “Parsing Error” in the same YastBooloader.
If there’s no default grub file gives this message:
I was almost able to recover the original GRUB file as you said, i had to remove most of the sections content from /etc/default/grub and leave them almost empty, what’s left was the 00_header one, custom.cfg section (has nothing) and the GRUB_THEME variable, but the YasT bootloader tool still doesn’t like it gives the same error as shown in the post above.
Please show your at /etc/default/grub . Here is mine:
knurpht@Lenovo-P16:/var/lib/libvirt> cat /etc/default/grub
# If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg' afterwards to update
# /boot/grub2/grub.cfg.
# Uncomment to set your own custom distributor. If you leave it unset or empty, the default
# policy is to determine the value from /etc/os-release
GRUB_DISTRIBUTOR=
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=2
GRUB_CMDLINE_LINUX_DEFAULT="splash=silent quiet security=apparmor mitigations=off"
GRUB_CMDLINE_LINUX=""
# Uncomment to automatically save last booted menu entry in GRUB2 environment
# variable `saved_entry'
# GRUB_SAVEDEFAULT="true"
#Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
# GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
#Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL="gfxterm"
# The resolution used on graphical terminal
#note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE="auto"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
# GRUB_DISABLE_LINUX_UUID=true
#Uncomment to disable generation of recovery mode menu entries
# GRUB_DISABLE_RECOVERY="true"
#Uncomment to get a beep at grub start
# GRUB_INIT_TUNE="480 440 1"
GRUB_BACKGROUND=
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
SUSE_BTRFS_SNAPSHOT_BOOTING="true"
GRUB_USE_LINUXEFI="true"
GRUB_DISABLE_OS_PROBER="false"
GRUB_ENABLE_CRYPTODISK="n"
GRUB_CMDLINE_XEN_DEFAULT="vga=gfx-1024x768x16"
Sorry i was out all day.
Just this to make this work:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/00_tuned ###
set tuned_params=""
export tuned_params
set tuned_initrd=""
export tuned_initrd
### END /etc/grub.d/00_tuned ###
### BEGIN /etc/grub.d/05_crypttab ###
### END /etc/grub.d/05_crypttab ###
### BEGIN /etc/grub.d/10_linux ###
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/35_fwupd ###
### END /etc/grub.d/35_fwupd ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###
### BEGIN /etc/grub.d/95_textmode ###
### END /etc/grub.d/95_textmode ###
GRUB_BACKGROUND=
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
Those sections used to have code and had to remove it.
This was the /etc/default/grub i have no idea how a copy of /boot/grub2/grub.cfg made it there, i’ve never touched GRUB when installed OpenSUSE a year and a half ago, but made it stuck to 6.14.6-1.
But hey it worked force-reinstalling grub2-common, seems its more simpler now.