Unable to boot Fedora from GRUB after every kernel update - BLS disabled & initrd line missing from grub.conf

I’ve been struggling to find a solution to a problem that I’ve been facing every time I upgrade the kernel on Fedora 39. When I first update (through the Discover update manager), my machine will reboot into the GRUB boot menu, and I can select the top entry. However, once the update completes, the new entry added to the GRUB boot menu (with the latest kernel) will no longer boot. It gets stuck only showing the line “Loading Linux …” presumably because my grub.cfg file is missing the initrd /boot/initramfs... line at the end of the boot listing. I can manually regenerate the grub.conf file by booting into the previous kernel and running grub2-mkconfig -o /boot/grub2/grub.cfg. However, I want to avoid needing to do this after every kernel upgrade. I suspect this has something to do with the ‘new’ Fedora Boot Loader Specification but don’t know how to solve it. For context, I’ve modified /etc/default/grub in order to use the Matter Customizable GRUB Theme. At some point in the installation process, I had seen that I would need to disable the new BLS in order for the theme to work. My goal is to be able to preserve the theme and fix the grub entry issue, but if I will need to enable BLS to do so, that is okay!

Related previous forum posts (the first one is very similar, but no real solution is proposed):
https://discussion.fedoraproject.org/t/f36-boot-stick-at-loading-linux-version-after-every-kernel-update/71866/6
https://www.reddit.com/r/linuxadmin/comments/jv4ies/initrd_line_missing_from_grubmenulst/
https://www.reddit.com/r/Fedora/comments/p72frz/custom_grub_ui_and_bls/
https://www.reddit.com/r/Fedora/comments/15py45g/missing_loading_initial_ramdisk_after_kernel/
https://serverfault.com/questions/609929/grub-conf-missing-initrd-path-after-kernel-update

The first forum post suggested this solution:

You will first need to fix the problem caused by running the grub2-mkconfig command by running
sudo rm /boot/grub2/grub.cfg /boot/efi/EFI/fedora/grub.cfg
then run
sudo dnf reinstall grub2-common grub2-efi*
followed by a reboot.
For future reference you may want to remember that the proper command is grub2-mkconfig -o /boot/grub2/grub.cfg

When I tried removing the cfg files and regenerating them with dnf install, I ran into a grub error because it seems that by default, Fedora adds a flag to /boot/efi/EFI/fedora/grub.cfg which makes grub fail on an LVM formatted partition. Once that was resolved, I was able to use grub2-mkconfig -o /boot/grub2/grub.cfg to regenerate the grub configuration, which succeeded.

Here are the contents of /boot/grub2/grub.cfg after a kernel update (booting into the previous kernel entry in grub so I can access Linux):

Contents of /boot/grub2/grub.cfg

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

set pager=1

if [ -f ${config_directory}/grubenv ]; then
load_env -f ${config_directory}/grubenv
elif [ -s $prefix/grubenv ]; then
load_env
fi
if [ “${next_entry}” ] ; then
set default=“${next_entry}”
set next_entry=
save_env next_entry
set boot_once=true
else
set default=“${saved_entry}”
fi

if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option=“–id”
else
menuentry_id_option=“”
fi

export menuentry_id_option

if [ “${prev_saved_entry}” ]; then
set saved_entry=“${prev_saved_entry}”
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z “${boot_once}” ]; then
saved_entry=“${chosen}”
save_env saved_entry
fi
}

function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}

if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod lvm
insmod btrfs
set root=‘lvmid/6Tigzm-tNKx-SfFm-DYKb-ht9M-iSwR-fec3ba/Ej90MA-x2xV-XQO9-vJ0i-fwDu-H1s4-VzfJoq’
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint=‘lvmid/6Tigzm-tNKx-SfFm-DYKb-ht9M-iSwR-fec3ba/Ej90MA-x2xV-XQO9-vJ0i-fwDu-H1s4-VzfJoq’ d2dfb70c-e23c-4459-931b-60c42a48f193
else
search --no-floppy --fs-uuid --set=root d2dfb70c-e23c-4459-931b-60c42a48f193
fi
font=“/usr/share/grub/unicode.pf2”
fi

if loadfont $font ; then
set gfxmode=1920x1200
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_gpt
insmod lvm
insmod btrfs
set root=‘lvmid/6Tigzm-tNKx-SfFm-DYKb-ht9M-iSwR-fec3ba/Ej90MA-x2xV-XQO9-vJ0i-fwDu-H1s4-VzfJoq’
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint=‘lvmid/6Tigzm-tNKx-SfFm-DYKb-ht9M-iSwR-fec3ba/Ej90MA-x2xV-XQO9-vJ0i-fwDu-H1s4-VzfJoq’ d2dfb70c-e23c-4459-931b-60c42a48f193
else
search --no-floppy --fs-uuid --set=root d2dfb70c-e23c-4459-931b-60c42a48f193
fi
insmod gfxmenu
loadfont ($root)/boot/grub2/themes/Matter/font.pf2
insmod png
set theme=($root)/boot/grub2/themes/Matter/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=30

Fallback normal timeout code in case the timeout_style feature is

unavailable.

else
set timeout=30
fi

END /etc/grub.d/00_header

BEGIN /etc/grub.d/01_users

if [ -f ${prefix}/user.cfg ]; then
source ${prefix}/user.cfg
if [ -n “${GRUB2_PASSWORD}” ]; then
set superusers=“root”
export superusers
password_pbkdf2 root ${GRUB2_PASSWORD}
fi
fi

END /etc/grub.d/01_users

BEGIN /etc/grub.d/06_grub-customizer_menu_color_helper

END /etc/grub.d/06_grub-customizer_menu_color_helper

BEGIN /etc/grub.d/08_fallback_counting

insmod increment

Check if boot_counter exists and boot_success=0 to activate this behaviour.

if [ -n “${boot_counter}” -a “${boot_success}” = “0” ]; then

if countdown has ended, choose to boot rollback deployment,

i.e. default=1 on OSTree-based systems.

if [ “${boot_counter}” = “0” -o “${boot_counter}” = “-1” ]; then
set default=1
set boot_counter=-1

otherwise decrement boot_counter

else
decrement boot_counter
fi
save_env boot_counter
fi

END /etc/grub.d/08_fallback_counting

BEGIN /etc/grub.d/10_linux

menuentry ‘Fedora Linux (6.7.10-200.fc39.x86_64) 39 (Workstation Edition)’ --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option ‘gnulinux-6.7.10-200.fc39.x86_64-advanced-d2dfb70c-e23c-4459-931b-60c42a48f193’ {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod lvm
insmod btrfs
set root=‘lvmid/6Tigzm-tNKx-SfFm-DYKb-ht9M-iSwR-fec3ba/Ej90MA-x2xV-XQO9-vJ0i-fwDu-H1s4-VzfJoq’
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint=‘lvmid/6Tigzm-tNKx-SfFm-DYKb-ht9M-iSwR-fec3ba/Ej90MA-x2xV-XQO9-vJ0i-fwDu-H1s4-VzfJoq’ d2dfb70c-e23c-4459-931b-60c42a48f193
else
search --no-floppy --fs-uuid --set=root d2dfb70c-e23c-4459-931b-60c42a48f193
fi
echo ‘Loading Linux 6.7.10-200.fc39.x86_64 …’
linux /boot/vmlinuz-6.7.10-200.fc39.x86_64 root=/dev/mapper/LVM-linux ro rd.lvm.lv=LVM/linux rhgb quiet pcie_aspm=force
}
menuentry ‘Fedora Linux (6.7.9-200.fc39.x86_64) 39 (Workstation Edition)’ --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option ‘gnulinux-6.7.9-200.fc39.x86_64-advanced-d2dfb70c-e23c-4459-931b-60c42a48f193’ {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod lvm
insmod btrfs
set root=‘lvmid/6Tigzm-tNKx-SfFm-DYKb-ht9M-iSwR-fec3ba/Ej90MA-x2xV-XQO9-vJ0i-fwDu-H1s4-VzfJoq’
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint=‘lvmid/6Tigzm-tNKx-SfFm-DYKb-ht9M-iSwR-fec3ba/Ej90MA-x2xV-XQO9-vJ0i-fwDu-H1s4-VzfJoq’ d2dfb70c-e23c-4459-931b-60c42a48f193
else
search --no-floppy --fs-uuid --set=root d2dfb70c-e23c-4459-931b-60c42a48f193
fi
echo ‘Loading Linux 6.7.9-200.fc39.x86_64 …’
linux /boot/vmlinuz-6.7.9-200.fc39.x86_64 root=/dev/mapper/LVM-linux ro rd.lvm.lv=LVM/linux rhgb quiet pcie_aspm=force
echo ‘Loading initial ramdisk …’
initrd /boot/initramfs-6.7.9-200.fc39.x86_64.img
}
menuentry ‘Fedora Linux (0-rescue-0143c499075c424eb5874207b52c88f4) 39 (Workstation Edition)’ --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option ‘gnulinux-0-rescue-0143c499075c424eb5874207b52c88f4-advanced-d2dfb70c-e23c-4459-931b-60c42a48f193’ {
load_video
insmod gzio
insmod part_gpt
insmod lvm
insmod btrfs
set root=‘lvmid/6Tigzm-tNKx-SfFm-DYKb-ht9M-iSwR-fec3ba/Ej90MA-x2xV-XQO9-vJ0i-fwDu-H1s4-VzfJoq’
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint=‘lvmid/6Tigzm-tNKx-SfFm-DYKb-ht9M-iSwR-fec3ba/Ej90MA-x2xV-XQO9-vJ0i-fwDu-H1s4-VzfJoq’ d2dfb70c-e23c-4459-931b-60c42a48f193
else
search --no-floppy --fs-uuid --set=root d2dfb70c-e23c-4459-931b-60c42a48f193
fi
echo ‘Loading Linux 0-rescue-0143c499075c424eb5874207b52c88f4 …’
linux /boot/vmlinuz-0-rescue-0143c499075c424eb5874207b52c88f4 root=/dev/mapper/LVM-linux ro rd.lvm.lv=LVM/linux rhgb quiet pcie_aspm=force
echo ‘Loading initial ramdisk …’
initrd /boot/initramfs-0-rescue-0143c499075c424eb5874207b52c88f4.img
}

END /etc/grub.d/10_linux

BEGIN /etc/grub.d/10_reset_boot_success

Hiding the menu is ok if last boot was ok or if this is a first boot attempt to boot the entry

if [ “${boot_success}” = “1” -o “${boot_indeterminate}” = “1” ]; then
set menu_hide_ok=1
else
set menu_hide_ok=0
fi

Reset boot_indeterminate after a successful boot

if [ “${boot_success}” = “1” ] ; then
set boot_indeterminate=0

Avoid boot_indeterminate causing the menu to be hidden more than once

elif [ “${boot_indeterminate}” = “1” ]; then
set boot_indeterminate=2
fi

Reset boot_success for current boot

set boot_success=0
save_env boot_success boot_indeterminate

END /etc/grub.d/10_reset_boot_success

BEGIN /etc/grub.d/12_menu_auto_hide

if [ x$feature_timeout_style = xy ] ; then
if [ “${menu_show_once}” ]; then
unset menu_show_once
save_env menu_show_once
set timeout_style=menu
set timeout=60
elif [ “${menu_auto_hide}” -a “${menu_hide_ok}” = “1” ]; then
set orig_timeout_style=${timeout_style}
set orig_timeout=${timeout}
if [ “${fastboot}” = “1” ]; then
# timeout_style=menu + timeout=0 avoids the countdown code keypress check
set timeout_style=menu
set timeout=0
else
set timeout_style=hidden
set timeout=1
fi
fi
fi

END /etc/grub.d/12_menu_auto_hide

BEGIN /etc/grub.d/14_menu_show_once

if [ x$feature_timeout_style = xy ]; then
if [ “${menu_show_once_timeout}” ]; then
set timeout_style=menu
set timeout=“${menu_show_once_timeout}”
unset menu_show_once_timeout
save_env menu_show_once_timeout
fi
fi

END /etc/grub.d/14_menu_show_once

BEGIN /etc/grub.d/20_linux_xen

END /etc/grub.d/20_linux_xen

BEGIN /etc/grub.d/20_ppc_terminfo

END /etc/grub.d/20_ppc_terminfo

BEGIN /etc/grub.d/30_os-prober

menuentry ‘Windows Boot Manager (on /dev/nvme0n1p1)’ --class windows --class os $menuentry_id_option ‘osprober-efi-BE01-739C’ {
insmod part_gpt
insmod fat
search --no-floppy --fs-uuid --set=root BE01-739C
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

Other OS found, undo autohiding of menu unless menu_auto_hide=2

if [ “${orig_timeout_style}” -a “${menu_auto_hide}” != “2” ]; then
set timeout_style=${orig_timeout_style}
set timeout=${orig_timeout}
fi

END /etc/grub.d/30_os-prober

BEGIN /etc/grub.d/30_uefi-firmware

if [ “$grub_platform” = “efi” ]; then
menuentry ‘UEFI Firmware Settings’ $menuentry_id_option ‘uefi-firmware’ {
fwsetup
}
fi

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

Contents of /etc/default/grub

GRUB_TIMEOUT=“30”
GRUB_DISTRIBUTOR=“$(sed ‘s, release .*$,g’ /etc/system-release)”
GRUB_DEFAULT=“saved”
GRUB_DISABLE_SUBMENU=“true”
#GRUB_TERMINAL_OUTPUT=“console”
GRUB_CMDLINE_LINUX=“rd.lvm.lv=LVM/linux rhgb quiet pcie_aspm=force”
GRUB_DISABLE_RECOVERY=“true”
GRUB_ENABLE_BLSCFG=“false”

Presumably, the above line is part of the issue, but it seems like I need it disabled for the grub theme to work?

GRUB_GFXMODE=“1920x1200”
GRUB_THEME=“/boot/grub2/themes/Matter/theme.txt”

The contents of /etc/grub.d

/etc/grub.d/
total 108K
-rwxr-xr-x. 1 root root 9.2K Feb 6 18:00 00_header
-rwxr-xr-x. 1 root root 236 Feb 6 18:00 01_users
-rwxr-xr-x. 1 root root 270 Feb 4 22:29 06_grub-customizer_menu_color_helper
-rwxr-xr-x. 1 root root 835 Feb 6 18:00 08_fallback_counting
-rwxr-xr-x. 1 root root 19K Feb 6 18:00 10_linux
-rwxr-xr-x. 1 root root 833 Feb 6 18:00 10_reset_boot_success
-rwxr-xr-x. 1 root root 892 Feb 6 18:00 12_menu_auto_hide
-rwxr-xr-x. 1 root root 410 Feb 6 18:00 14_menu_show_once
-rwxr-xr-x. 1 root root 14K Feb 6 18:00 20_linux_xen
-rwxr-xr-x. 1 root root 2.6K Feb 6 18:00 20_ppc_terminfo
-rwxr-xr-x. 1 root root 11K Feb 6 18:00 30_os-prober
-rwxr-xr-x. 1 root root 1.1K Feb 6 18:00 30_uefi-firmware
-rwxr-xr-x. 1 root root 725 Mar 10 19:00 35_fwupd
-rwxr-xr-x. 1 root root 218 Feb 6 18:00 40_custom
-rwxr-xr-x. 1 root root 219 Feb 6 18:00 41_custom
drwxr-xr-x. 1 root root 102 Feb 4 22:29 backup
-rw-r–r–. 1 root root 483 Feb 6 18:00 README

Below is all of my relevant fpaste information:

fpaste
=== fpaste 0.4.5.1 System Information ===
* OS Release (lsb_release -ds):
     "Fedora Linux 39 (Workstation Edition)"
     
* Kernel (uname -r ; cat /proc/cmdline):
     6.7.9-200.fc39.x86_64
     BOOT_IMAGE=/boot/vmlinuz-6.7.9-200.fc39.x86_64 root=/dev/mapper/LVM-linux ro rd.lvm.lv=LVM/linux rhgb quiet pcie_aspm=force
     
* Desktop(s) Running (without results: "ps -eo comm= | grep -E '(gnome-session|startkde|startactive|xfce.?-session|fluxbox|blackbox|hackedbox|ratpoison|enlightenment|icewm-session|od-session|wmaker|wmx|openbox-lxde|openbox-gnome-session|openbox-kde-session|mwm|e16|fvwm|xmonad|sugar-session|mate-session|lxqt-session|cinnamon|lxdm-session)' "):
     N/A

* Desktop(s) Installed (ls -m /usr/share/xsessions/ | sed 's/\.desktop//g' ):
     gnome-classic, gnome-classic-xorg, gnome,
     gnome-xorg, i3, i3-with-shmlog, plasmax11
     
* SELinux Status (sestatus):
     SELinux status:                 enabled
     SELinuxfs mount:                /sys/fs/selinux
     SELinux root directory:         /etc/selinux
     Loaded policy name:             targeted
     Current mode:                   enforcing
     Mode from config file:          enforcing
     Policy MLS status:              enabled
     Policy deny_unknown status:     allowed
     Memory protection checking:     actual (secure)
     Max kernel policy version:      33
     
* SELinux Errors (without results: "selinuxenabled && journalctl --since yesterday |grep avc: | grep -Eo comm="[^ ]+" | sort |uniq -c |sort -rn"):
     N/A

* CPU Model (grep 'model name' /proc/cpuinfo | awk -F: '{print $2}' | uniq -c |
     sed -re 's/^ +//' ):
     16  AMD Ryzen 7 PRO 6850U with Radeon Graphics
     
* 64-bit Support (grep -q ' lm ' /proc/cpuinfo && echo Yes || echo No):
     Yes
     
* Hardware Virtualization Support (grep -Eq '(vmx|svm)' /proc/cpuinfo && echo Yes || echo No):
     Yes
     
* Load average (uptime):
      17:10:00 up  1:21,  3 users,  load average: 1.69, 1.46, 1.32
     
* Pressure Stall Information (grep -R . /proc/pressure/):
     /proc/pressure/io:some avg10=0.00 avg60=0.05 avg300=0.16 total=18432500
     /proc/pressure/io:full avg10=0.00 avg60=0.05 avg300=0.16 total=18138302
     /proc/pressure/cpu:some avg10=0.00 avg60=0.00 avg300=0.00 total=15752096
     /proc/pressure/cpu:full avg10=0.00 avg60=0.00 avg300=0.00 total=0
     /proc/pressure/irq:full avg10=0.00 avg60=0.00 avg300=0.00 total=14672475
     /proc/pressure/memory:some avg10=0.00 avg60=0.00 avg300=0.00 total=3347
     /proc/pressure/memory:full avg10=0.00 avg60=0.00 avg300=0.00 total=3293
     
* Memory usage (free -m):
                    total        used        free      shared  buff/cache   available
     Mem:           31396        6624       21646         125        3681       24772
     Swap:           8191           0        8191
     
* ZRAM usage (zramctl --output-all):
     NAME       DISKSIZE DATA COMPR ALGORITHM STREAMS ZERO-PAGES TOTAL MEM-LIMIT MEM-USED MIGRATED MOUNTPOINT
     /dev/zram0       8G   4K   80B lzo-rle        16          0   12K        0B      12K       0B [SWAP]
     
* Top 5 CPU hogs (ps axuScnh | awk '$2!=8038' | sort -rnk3 | head -5):
         1000    3137 31.4  2.8 5025356 925008 ?      Sl   15:48  25:31 firefox
         1000    7857 12.6  0.4 1666264 145452 ?      Sl   17:09   0:00 konsole
         1000    7875  8.0  0.0 228280  9088 pts/1    Ss   17:09   0:00 bash
         1000    2134  5.3  0.8 2284512 265308 ?      Sl   15:48   4:21 kwin_wayland
         1000    3405  4.7  0.6 3220124 219820 ?      Sl   15:49   3:50 Isolated Web Co
     
* Top 5 Memory hogs (ps axuScnh | sort -rnk4 | head -5):
         1000    3137 31.4  2.8 5025356 925008 ?      Sl   15:48  25:31 firefox
         1000    2315  1.5  1.5 5679300 494556 ?      Ssl  15:48   1:13 plasmashell
         1000    2736  0.1  1.1 1986272 381232 ?      Ssl  15:48   0:06 DiscoverNotifie
         1000    3878  1.0  1.0 3016776 350348 ?      Sl   15:50   0:48 Isolated Web Co
         1000    3412  0.7  0.8 2885816 264304 ?      Sl   15:49   0:34 Isolated Web Co
     
* Disk space usage (df -hT):
     Filesystem            Type      Size  Used Avail Use% Mounted on
     /dev/mapper/LVM-linux btrfs     883G   20G  863G   3% /
     devtmpfs              devtmpfs  4.0M     0  4.0M   0% /dev
     tmpfs                 tmpfs      16G     0   16G   0% /dev/shm
     efivarfs              efivarfs  150K   81K   64K  56% /sys/firmware/efi/efivars
     tmpfs                 tmpfs     6.2G  2.3M  6.2G   1% /run
     tmpfs                 tmpfs      16G  8.0K   16G   1% /tmp
     /dev/nvme0n1p1        vfat       96M   46M   51M  48% /boot/efi
     tmpfs                 tmpfs     3.1G  160K  3.1G   1% /run/user/1000

...
* EFI boot manager output (efibootmgr -v):
     BootCurrent: 0000
     Timeout: 0 seconds
     BootOrder: 0000,0002,0005,0006,0003,0004,0001
     Boot0000* Fedora   HD(1,GPT,8b1b0a61-1abf-4eca-851f-886873effdc2,0x800,0x32000)/\EFI\fedora\shimx64.efi
           dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 03 00 00 00 00 00 61 0a 1b 8b bf 1a ca 4e 85 1f 88 68 73 ef fd c2 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 66 00 65 00 64 00 6f 00 72 00 61 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
     Boot0001* Wi-Fi IPV6 Network       PciRoot(0x0)/Pci(0x2,0x2)/Pci(0x0,0x0)/MAC(bcf4d4e3205b,1)/Wi-Fi(00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00)/IPv6([::],0,Static,[::],[::],64)4eac0881119f594d850ee21a522c59b21940000049535048
           dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 02 02 / 01 01 06 00 00 00 / 03 0b 25 00 bc f4 d4 e3 20 5b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 / 03 1c 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 / 03 0d 3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 / 7f ff 04 00
         data: 4e ac 08 81 11 9f 59 4d 85 0e e2 1a 52 2c 59 b2 19 40 00 00 49 53 50 48
     Boot0002* Windows Boot Manager     HD(1,GPT,8b1b0a61-1abf-4eca-851f-886873effdc2,0x800,0x32000)/\EFI\Microsoft\Boot\bootmgfw.efi57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000000050100000010000000040000007fff04000400000049535048
           dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 03 00 00 00 00 00 61 0a 1b 8b bf 1a ca 4e 85 1f 88 68 73 ef fd c2 02 02 / 04 04 46 00 5c 00 45 00 46 00 49 00 5c 00 4d 00 69 00 63 00 72 00 6f 00 73 00 6f 00 66 00 74 00 5c 00 42 00 6f 00 6f 00 74 00 5c 00 62 00 6f 00 6f 00 74 00 6d 00 67 00 66 00 77 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
         data: 57 49 4e 44 4f 57 53 00 01 00 00 00 88 00 00 00 78 00 00 00 42 00 43 00 44 00 4f 00 42 00 4a 00 45 00 43 00 54 00 3d 00 7b 00 39 00 64 00 65 00 61 00 38 00 36 00 32 00 63 00 2d 00 35 00 63 00 64 00 64 00 2d 00 34 00 65 00 37 00 30 00 2d 00 61 00 63 00 63 00 31 00 2d 00 66 00 33 00 32 00 62 00 33 00 34 00 34 00 64 00 34 00 37 00 39 00 35 00 7d 00 00 00 00 05 01 00 00 00 10 00 00 00 04 00 00 00 7f ff 04 00 04 00 00 00 49 53 50 48
     Boot0003  USB NETWORK BOOT:        PciRoot(0x0)/Pci(0x8,0x3)/Pci(0x0,0x3)/USB(1,0)/MAC(606d3cfa03d3,0)/IPv6([::],0,Static,[::],[::],64)4eac0881119f594d850ee21a522c59b21b30000049535048
           dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 03 08 / 01 01 06 00 03 00 / 03 05 06 00 01 00 / 03 0b 25 00 60 6d 3c fa 03 d3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 / 03 0d 3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 / 7f ff 04 00
         data: 4e ac 08 81 11 9f 59 4d 85 0e e2 1a 52 2c 59 b2 1b 30 00 00 49 53 50 48
     Boot0004* Wi-Fi IPV4 Network       PciRoot(0x0)/Pci(0x2,0x2)/Pci(0x0,0x0)/MAC(bcf4d4e3205b,1)/Wi-Fi(00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00)/IPv4(0.0.0.0,0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0)4eac0881119f594d850ee21a522c59b21938000049535048
           dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 02 02 / 01 01 06 00 00 00 / 03 0b 25 00 bc f4 d4 e3 20 5b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 / 03 1c 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 / 03 0c 1b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 / 7f ff 04 00
         data: 4e ac 08 81 11 9f 59 4d 85 0e e2 1a 52 2c 59 b2 19 38 00 00 49 53 50 48
     Boot0005  USB:     PciRoot(0x0)/Pci(0x8,0x1)/Pci(0x0,0x3)4eac0881119f594d850ee21a522c59b20b18000049535048
           dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 01 08 / 01 01 06 00 03 00 / 7f ff 04 00
         data: 4e ac 08 81 11 9f 59 4d 85 0e e2 1a 52 2c 59 b2 0b 18 00 00 49 53 50 48
     Boot0006  USB NETWORK BOOT:        PciRoot(0x0)/Pci(0x8,0x3)/Pci(0x0,0x3)/USB(1,0)/MAC(606d3cfa03d3,0)/IPv4(0.0.0.0,0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0)4eac0881119f594d850ee21a522c59b21b28000049535048
           dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 03 08 / 01 01 06 00 03 00 / 03 05 06 00 01 00 / 03 0b 25 00 60 6d 3c fa 03 d3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 / 03 0c 1b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 / 7f ff 04 00
         data: 4e ac 08 81 11 9f 59 4d 85 0e e2 1a 52 2c 59 b2 1b 28 00 00 49 53 50 48

Thank you very much for any support you can provide!

Removed amd, cinnamon, f36, gnome, kde, radeon

That should be chanted to “true” if you wish grub updates to work properly when a new kernel is installed

When blscfg is disabled grub is unable to properly built the grub boot menu during boot. The grub boot menu is not static, but is built by grub during the first stages of the boot process

I don’t use a grub theme so cannot assist with that matter

Wow, this feels like a really basic suggestion that I should have tried before – I don’t know why I thought that BLS and Grub themes were somehow incompatible! I just uninstalled and reinstalled the latest kernel version with dnf after making this change, and am able to boot into the latest kernel without issues. (Weirdly, there’s no more output to the screen after the boot selection now, it just immediately cuts to black.)
I will update this post if this doesn’t stick for the next kernel update, otherwise thank you!

Meaning it goes to black and does not boot? or that it goes to black while continuing to boot?

Sorry for the ambiguity - it does indeed continue to boot (the next thing I see is the fedora + OEM logo screen with the loading circle).

Thanks for the update.
To me that seems normal as it switches from the grub menu display to the plymouth display (after the gpu drivers have loaded). Timing depends upon how long it takes to load the drivers (and everything before that)

My boot takes about 13 seconds from grub to login so the black screen would only be a couple seconds.

I feel like this is not the correct solution. Running sudo grub2-mkconfig -o /boot/grub2/grub.cfg correctly generates the grub config and allows booting into the newly installed kernel, even with BLS disabled. Why is the automated grub config generation as part of the update process failing to do this?

Fedora’s kernel update process is clearly broken if it’s not adding the initramfs line to the grub config despite it working perfectly when running the command manually.

I quite like the Fedora grub theme, but I disabled BLS so I could have the previous kernels nested under a sub-menu, both for Fedora and MX Linux which I’m dual-booting. If there is a way to to achieve this with BLS enabled I’m all ears, but either way, Fedora need to fix their post-update grub config generation.

grub2-mkconfig is reflecting the actual configuration in the generated file, and does not reference files which do not exist, which is generally spoken good.

But at some moment went in the kernel installation process that the grub2-mkconfig is called with kernel in place but initrd not yet generated. The result you know.

A second call to grub2-mkconfig afterwards is OK. As is stated on this forum that BLSCFG=false is no longer supported, the solution is to switch to BLS configuration, reinstall kernel and redo grub2-mkconfig.

But BLS seems to break core grub functionality, namely sub-menus, which are practically a requirement in any multi-boot setup with distros that keep previous kernels - a feature I agree with and have no intention to disable. Fedora should not be calling grub2-mkconfig before the initramfs exists.

You could try to create an extra plugin for running grub2-mkconfig like this: create a shell script in the /etc/kernel/install.d/ directory and name it for example /etc/kernel/install.d/90-run-grub2-mkconfig.install and make it executable using the chmod a+x command. The contents is a regular shell program where the first line is #!/bin/sh or #!/usr/bin/bash. The shell program should then do whatever is needed to call grub2-mkconfig with the right parameter.

This may work, or it may not work; I haven’t tested it.

1 Like

That looks promising! There is already a plugin that calls grub2-mkconfig in position 99 but it is quite complicated and does a lot of stuff first that I don’t really understand, so I’ve made mine run after it rather than instead of it. We’ll see what happens on the next kernel update :sweat_smile:

❯ l /usr/lib/kernel/install.d/
total 62k
-rwxr-xr-x. 1 root root 2.0k Jan 24 00:00 10-devicetree.install*
-rwxr-xr-x. 1 root root 9.1k May 29 01:00 20-grub.install*
-rwxr-xr-x. 1 root root 2.1k Jun 25 10:37 50-depmod.install*
-rwxr-xr-x. 1 root root 3.3k May 16 01:00 50-dracut.install*
-rwxr-xr-x. 1 root root 4.7k May 16 01:00 51-dracut-rescue.install*
-rwxr-xr-x. 1 root root  791 Oct 24  2023 60-kdump.install*
-rwxr-xr-x. 1 root root 7.2k Jun 29 01:00 90-loaderentry.install*
-rwxr-xr-x. 1 root root 3.2k Jun 25 10:37 90-uki-copy.install*
-rwxr-xr-x. 1 root root  204 Oct 24  2023 92-crashkernel.install*
-rwxr-xr-x. 1 root root  675 Jan 24 00:00 95-kernel-hooks.install*
-rwxr-xr-x. 1 root root 2.0k May 29 01:00 99-grub-mkconfig.install*
❯ l /etc/kernel/install.d/
total 8.2k
-rwxr-xr-x. 1 root root 2.0k Jul 15 17:09 98-original-grub-mkconfig.install*
-rwxr-xr-x. 1 root root   49 Jul 15 17:03 99-grub-mkconfig.install*
❯ sudo nano /etc/kernel/install.d/99-grub-mkconfig.install
#!/bin/sh
grub2-mkconfig -o /boot/grub2/grub.cfg

hey there… i’ve the same issue… and let me guess, you’ve installed ah grub2 theme (like darkmatter? with this pyhton 3 script)

somehow these customization looks like to add the blscfg config and set it to false! i’ll just have commented out the the line now… as i just also got the newest kernel and run into this issue again i’ll have to wait for the next update to see if this is fixed…

at least in grub i didn’t see any issue yet with this option changed…

I just got the 6.9.9 kernel update and, after rebooting, the grub entry had the proper initramfs line and booted into Fedora perfectly. Could be a cosmic coincidence but I’ll take it as a good sign that the solution in my previous comment (inspired by @vekruse) is working :+1:

Hey, I’ve hit this too and arrived to the same conclusions, some of the scripting in /etc/grub.d/10_linux or in /usr/lib/kernel/install.d/20-grub.install or /usr/lib/kernel/install.d/99-grub-mkconfig.install seems to not work as intended. I’ll try to investigate it a bit more and/or open a bug report.

I have GRUB_ENABLE_BLSCFG="true" and dnf reinstall kernel kernel-core kernel-modules kernel-modules-core shows:

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.9.11-200.fc40.x86_64
fgrep: warning: fgrep is obsolescent; using grep -F
Found linux image: /boot/vmlinuz-6.9.10-200.hardened.fc40.x86_64
Found initrd image: /boot/initramfs-6.9.10-200.hardened.fc40.x86_64.img
fgrep: warning: fgrep is obsolescent; using grep -F
Found linux image: /boot/vmlinuz-6.9.9-200.fc40.x86_64
Found initrd image: /boot/initramfs-6.9.9-200.fc40.x86_64.img
fgrep: warning: fgrep is obsolescent; using grep -F
Adding boot menu entry for UEFI Firmware Settings ...

Easy to test, see as the first match misses the initramfs. Running grub2-mkconfig by hand works as intended and pick up the initramfs. So indeed, putting it last in /usr/lib/kernel/install.d will “fix” it though presumably grub2-mkconfig then runs several times.

In my opinion if there’s an option to remove bfscfg, all of it should work

1 Like

Well, the issue seems to be that none of the install.d scripts actually call grub2-mkconfig except in very specific situations.

  • In 20-grub.install, grub2-mkconfig may be called once the kernel is copied in /boot on line 104. This is before the initram is generated (50-dracut.install and 51-dracut-rescue.install) so that sets up a grub entry without initram
  • In 99-grub-mkconfig.install but only in specific conditions (that set RUN_MKCONFIG=true) and the scripts exits on line 49 if this is not set, before running grub2-mkconfig.

So indeed, dropping a snippet later than 99-grub-mkconfig.install works. I have settled for something else which is having:

grep -Eq '^GRUB_ENABLE_BLSCFG="?false"?' /etc/default/grub && RUN_MKCONFIG=true 

before line 49 of 99-grub-mkconfig.install, which I think makes sense.

Edit: after second thoughts, better to use /etc/kernel/install.d where I’ve put my script, eg. /etc/kernel/install.d/55-grub-mkconfig.install (so that it runs after dracut generates the initramfs) with the following, taken from the script /usr/lib/kernel/install.d/99-grub-mkconfig.install

#!/usr/bin/bash

[[ -f /etc/default/grub ]] && . /etc/default/grub
# Testing != false so that we exit if GRUB_ENABLE_BLSCFG is unset
if [[ $GRUB_ENABLE_BLSCFG != false ]]; then
    exit 0
fi

COMMAND="$1"

case "$COMMAND" in
    add|remove)
        grub2-mkconfig --no-grubenv-update -o /boot/grub2/grub.cfg >& /dev/null
        ;;
    *)
        ;;
esac