The problem I’m trying to debug is: At every boot, the second boot entry in the grub menu is selected (not the latest kernel, but the one that was installed before it, usually one version older). I tried digging through log files and the systemd journal, but the only entries I could find are:
Starting Mark boot as successful...
grub-boot-success.service: Deactivated successfully.
Finished Mark boot as successful.
This seems to me that everything is fine, the boot succeeded, no problems, and next time, the same kernel should be booted again. However, after rebooting, the second entry (an older kernel, not the one that was supposedly marked as “successful”) is preselected again.
I have also checked grubenv, where the saved_entry
points to the latest kernel, and boot_success=1
is listed. Still, at next boot, grub chooses an older kernel again (always the one at position 2).
I tried digging through systemd unit files (grub2-systemd-integration.service, grub-boot-{success,indeterminate}.service) and /usr/libexec/grub2/systemd-integration.sh, but I find it hard to understand how they are supposed to work.
Any idea what might cause this? As I said, logs and journal show only that everything worked, the grubenv file is exactly 1024 bytes long, and this issue has been bugging me (no pun intended - okay, maybe a little) for months, on both Fedora 33 and 34.