/etc/default/grub contains GRUB_DEFAULT=saved, but doesn’t include GRUB_SAVEDEFAULT=true so that it actually remembers the last booted entry and selects that by default.
Since I dual-boot with Windows that’s something I always change after installing Fedora, because sometimes Windows installs updates first and then reboots. So you turn on your computer, select Windows, come back a bit later only to find that Fedora has booted.
It’s even worse when Windows decides to install updates on shutdown. For that it also reboots, meaning that if I select “Update and shut down”, go afk and come back later, the PC is still on, booted into Fedora.
And it isn’t only Windows that does that, Fedora’s offline updates also behave the same way (e.g. reboot when you choose to install them on shutdown).
My guess is that while GRUB_SAVEDEFAULT=true might make sense when dual-booting Fedora and Windows, it does less so when only Fedora is installed, given that selecting a previous kernel on one particular occasion would keep the user on older kernels until they manually intervene.
The line GRUB_SAVEDEFAULT=true has the effect that whatever kernel was last booted is then saved as the default kernel. It should not be in that file unless the user intends to manually select the kernel to be booted (for example when booting windows instead of fedora most of the time) or they are having problems with a newer kernel and want to have a different kernel boot always by default.
As you noted, it is quite useful in some circumstances but would severely impact the average user who boots without the grub menu and thus would never boot to a newer kernel by default.
I’ve just tested it with the 7.2.7 update: No, after upgrading and rebooting it still picked the top entry, i.e. the latest kernel. Was this a coincidence?
/usr/lib/kernel/install.d/95-set-boot-entry.install seems to take care of making a new kernel the saved GRUB default when it is installed, overriding the previous default.
It overrides the previous default for the next boot when installing a new kernel, but if the user then picks a different kernel the selected one remains the new default as long as the line GRUB_SAVEDEFAULT=true remains in the file /etc/default/grub.
Yes, isn’t that a feature? If I select an older kernel explicitly it probably is because there’s a problem with the new one. And if I select an older kernel I would expect my system to boot with it - even when I don’t watch it the whole time. But without GRUB_SAVEDEFAULT=true the login screen I see after coming back from the toilet might be with a different kernel because a pending offline update had triggered a reboot.
So I would say this would also benefit users that don’t dual-boot.
Indeed. It would be irritating to have to keep manually selecting away from the newest kernel when you know it’s broken.
There are alternative ways to do it (like using grubby on the command line), but the behaviour of GRUB_SAVEDEFAULT seems friendlier to users who just want to use a menu once and be able to ignore the problematic latest kernel until a new one arrives in an update.
As long as the default has never been changed from index 0 by manually selecting a different kernel it would have no affect. If the user had manually changed the boot kernel while that option is set (and some do) then the selected kernel would always be booted until a new kernel was installed (which overrides the selection as noted above).
Users who do not see the grub menu would not be aware of what is hidden.
Anyone can force the grub menu to display while booting and select a different kernel while it is displayed.
Anyone can edit the file /etc/default/grub without seeing the grub menu.