How change the default boot sequence of dual boot of Win 10 & Rocky 8.5

The Grub boot menu is okay, but when I want change the default menu option to Windows 10, I can’t find the correct configuration file to made it.
I remember I can do this operation easily in CentOS 7/Windows 10 Enviroment.
my boot menu’s screenshot is as following:

Does any guru know where is the configuration file for change the default bootmenu option?

Thanks first! :pray:

I don’t have EL8 in dual boot. Well, I do, but with EFI. I have two boot entries in EFI: GRUB and Windows. GRUB is first, but EFI default is Windows. If I do nothing, Windows boots. If I hit ‘F12’, the EFI boot menu shows. Plain ‘Enter’ selects first entry: GRUB. GRUB menu shows and loads shortly the default: latest kernel.

On CentOS 7 systems I have had GRUB_DEFAULT="Windows 10" in /etc/default/grub, which makes
grub2-mkconfig to include set default="Windows 10" in grub.cfg.

In same directory as grub.cfg I had custom.cfg that had the menuentry 'Windows 10'. The usual chainloader stanza.

The grub.cfg in EL8 does still have the

### 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;
### END /etc/grub.d/41_custom ###

so one can create the custom.cfg, but since you have entry for Windows that is not necessary.

The beginning of grub.cfg has

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

when GRUB_DEFAULT=saved so if the grubenv contains saved_entry=(name|id|index)_of_windows_entry (probably set with grub2-set-default), then what happens?

(The reason I have separate custom.cfg is that if I rename that file, then GRUB picks first entry - -the latest kernel.)

SIGH!!! RH likes to make miserable for users. Just when everyone is accepted GRUB 2 as miserable as it was, RH has once again pulled the rug out from under our feet… because RH no longer uses GRUB2 config files /boot/grub2/grub.cfg. Instead they now use /boot/ loader/entries. This change explains why it was easy to due in CentOS 7.x which still used /boot/grub2/grub.cfg and seems to not work in Rocky Linux 8.5 which now uses /boot/loader/entries.

Best Wishes

[quote=“desercat, post:3, topic:5643”]
… because RH no longer uses GRUB2 config files /boot/grub2/grub.cfg. Instead they now use /boot/ loader/entries. [/quote]

EL8 does use GRUB2 and GRUB2 does use grub.cfg. The only difference is that without BLS the boot stanzas are in the grub.cfg and every kernel add/remove has to edit grub.cfg, while with BLS each stanza is in separate file – all included by grub.cfg – and kernel add/remove neatly adds/removes files.

Besides, you can disable BLS.