On 5/5/19 6:29 PM, Chris Murphy wrote:
On Sun, May 5, 2019 at 8:22 AM Steven A. Falco stevenfalco@gmail.com wrote:
I just upgraded my machine from F29 to F30. Now, whenever I install a new kernel, the new kernel does not automatically become the default. In other words, when I reboot, the previous kernel is still chosen by grub2.
I can manually choose the new kernel in the grub2 menu, at which point it _does_ become the new default. I don't wind up at the "grub>" prompt, so I think grub2 itself is fine. It is just that the grubenv is not updated when the new kernel is installed.
The machine has UEFI, but the system boots using the legacy BIOS compatibility layer. I know that the boot mechanism changed a bit for F30, but I'm not sure where to look to identify the cause of this problem. It doesn't seem to be the same issue as described in BZ 1652806.
Post your /etc/default/grub file
I'm willing to bet there's a line
GRUB_SAVEDEFAULT=true
If so, delete that line or comment it out and then run the usual grub2-mkconfig and directing the output to the proper grub.cfg path for your firmware type.
The default that should be honored is found in the grubenv file, which (curiously) is found at the same path no matter your firmware type: /boot/efi/EFI/fedora/grubenv
You can list its contents
# grub2-editenv list
And you can change it with
#grub2-set-default <title of kernel>
The title of the kernel is found in the /boot/loader/entries/*conf files - there is one file for each kernel.
Thanks for the explanation. Here are the contents of /etc/default/grub. As you suspected, there is a GRUB_DEFAULT=saved line in there.
GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="resume=/dev/mapper/fedora-swap rd.lvm.lv=fedora/root rd.md.uuid=77ae1678:58a79067:c0ad29e6:bd1862f8 rd.md.uuid=bac1fa34:2d7a26e5:969d63ac:33ff4572 rd.lvm.lv=fedora/swap" GRUB_DISABLE_RECOVERY="true" GRUB_ENABLE_BLSCFG=true
I looked for grubenv, and the only one I found is at /boot/grub2/grubenv. There is nothing in /boot/efi/EFI/fedora. This machine was set up on 2018-11-24, so it started life as a Fedora 29 machine.
Is there a command I should run to move grubenv to /boot/efi/EFI/fedora? I think I would also have to create a symlink from /boot/efi/EFI/fedora/grubenv to /etc/default/grub. I could of course do it manually, but if there is a better procedure, like re-installing some package(s), that would be preferable.
Steve