How to set to make fedora update but not changing NVRAM and default UEFI boot item

Each time the fedora updates, the NVRAM is changed and the default UEFI boot item is changed.How could I set to make fedora update but not changing NVRAM and default UEFI boot item.I

Hi @1457384613fdr , welcome to the forum.

Do you mean the update to the boot list so that the newest kernel is selected by default (Fedora keeps 3 kernels installed by default).

Or is it something else you are referring to?

How to make fedora unabled to change default UEFI boot item, so that [Windows Boot Manager], [RefindPlus.efi] or other could be always default.

There is five operating systems installed on my Laptop, I would love to load [RefindPlus.efi] to choose an OS rather than load fedora directly without my choosing. After updating fedora again and again, I should set to make [RefindPlus.efi] default over and over again, so I would like to set to make efi grub of fedora unabled to be default automatically, but I don’t know what to do.

1 Like

You can set a default, and I think it should not be changed on kernel updates:

https://docs.fedoraproject.org/en-US/quick-docs/bootloading-with-grub2/#setting-default-entry

Not done this recently, though, so I can’t confirm.

I’m sorry but what I want to express is not list of efi grub of fedora.

There is a list behind my bios setup, like this.

①[RefindPlus]
②[Windows Boot Manager]
③[fedora]
④[Brunch Framework]
⑤[OpenCore]
⑥[USB]
⑦[Network]

If I choose [fedora], it will load efi grub of fedora.

After updating kernel of fedora, the list is always changed.

①[fedora]
②[RefindPlus]
③[Windows Boot Manager]
④[Brunch Framework]
⑤[OpenCore]
⑥[USB]
⑦[Network]

fedora turn the third into the first.

How to do to keep efi grub of fedora the third from becoming the first.

1 Like

Hrm, OK, I understand what you mean. I don’t know if this is by design or a bug, so perhaps it’s worth filing a bug against the kernel saying “Kernel updates overwrite NVRAM” or something? That’s because I’m not aware of a way to change the commands that are run on a kernel update. So it could be something that’s hard-coded in the kernel packages maybe?


From what I can see, kernel updates call /usr/bin/kernel-install, which runs the scripts in the /usr/lib/kernel/install.d directory. I see grub, grubby related bits there, so they’re what I expect modify the boot loader etc.

I just don’t know enough about the kernel install process and how it update grub to tell you the exact answer.

Have you tried with efibootmgr to see what is happening.?
The output for me is like this, and the line that begins with BootOrder tells the default order while BootCurrent tells the one which was just booted.

efibootmgr can be used to change the default order as well.

$ efibootmgr
BootCurrent: 0000
Timeout: 3 seconds
BootOrder: 0000,000D,000E,000F
Boot0000* Fedora
Boot000D* Fedora
Boot000E* Hard Drive
Boot000F* CD/DVD Drive

Whether overwriting NVRAM is by design or a bug, would upcoming newer fedora give users the right to set and keep the default UEFI boot entry that users like?

If fedora is installed with MBR+legacy, and the Master Boot Record is bootmgr, it cannot turn bootmgr into grub and user can load grub of fedora by using edited BCD.
So it is not big deal Whether fedora is the default operating system or not.
And why to cause NVRAM loss little more ?

I just tested upgrading kernel only by using sudo dnf upgrade kernel* and the boot order didn’t change.

If we check the configuration of kernel-install shared by @ankursinha there no line that using grub2-install and from that I believe there nvram should not updated and only grub.cfg and loader list.

You could check grub2-install --help there an option --no-nvram to not update the nvram, means by default grub2-install will update the nvram if run without --no-nvram option. But none of kernel-install use this command.

I guess, but not sure, your system have custom driver that need to build new modules or you are using Fedora Silverblue/Kinoite that need to reboot after performing upgrade.

I also tested by running grub2-mkconfig and dracut but both of them also not change the BootOrder or adding efi BootNext variable.

Efi spec: https://uefi.org/sites/default/files/resources/UEFI_Spec_2_9_2021_03_18.pdf

1 Like

Sorry, I wasn’t clear enough. I mean that we haven’t been able to pin point what is changing the order yet, and if it is something from the Fedora packages, we don’t know if that is intentional or a bug. The best people who can confirm if it’s a Fedora related problem will be the kernel and grub maintainers. So, you should file a bug and speak to them.