Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1704926

Summary: GRUB_ENABLE_BLSCFG=true breaks GRUB_DEFAULT=saved
Product: [Fedora] Fedora Reporter: jshatch
Component: grub2Assignee: Peter Jones <pjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 30CC: abuse, ajschorr, a.korsunsky, arpanbiswas97, a.worlitschek, baumanmo, bugzilla-redhat, fmartine, fritz, garrett.mitchener, ghborrmann, lists, lkundrak, mpredosin, mtessun, peter, peter.kozics, pjones, Sascha.Zorn, stanley.king, stepglenn, thechexmo, theo148, todd_lewis, voyde, work.eric
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: grub2-2.02-88.fc30 grub2-2.02-105.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-31 01:12:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch which fixes the bug
none
Improved patch for fc30
none
Improved patch for fc31 (grub2-1:2.02-104) none

Description jshatch 2019-04-30 19:42:15 UTC
Description of problem:
In Fedora 29 and earlier having the following in /etc/default/grub caused Grub to remember the last booted entry:

GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved

Now that individual entries for Linux kernels are not in the generated grub.cfg the only thing in there is Windows, which is always selected as default if those options are set.

Commenting out GRUB_ENABLE_BLSCFG=true fixes this behavior but it appears the call in the kernel RPMs for grub2_mkconfig is gone now so we have to run that manually every time a kernel is updated.

Version-Release number of selected component (if applicable):
Fedora 30
Grub2 - 2.02-78

How reproducible:
Always

Steps to Reproduce:
1.  On a machine set to dual boot between F30 and Windows set the following variables in /etc/default/grub:
GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved

2.  Run grub2-mkconfig -o <wherever your config is located, EFI or not>
3.  Boot to Windows, noting previous default selection
4.  Boot back to Fedora, noting the default has changed to Windows
5.  Reboot the machine and note the default selection is still Windows

Actual results:
The default selection has not changed back to Fedora

Expected results:
The default selection should *always* be the last booted selection if those options are set in /etc/default/grub



Additional info:

Comment 1 Peter Bieringer 2019-06-02 18:11:52 UTC
problem hits me at least on 2 systems also

Comment 2 Peter Bieringer 2019-06-03 05:55:03 UTC
Windows entries still have "savedefault" in their section, while Linux *.conf entries in /boot/loader/entries/ misses that...but a manual adding per conf-file won't work, option looks like ignored if appended, and whole entry is ignored in case of put as first line.

imho blscfg developers must be involved and tell, how they (hopefully) implemented the "savedefault" feature for Linux entries into blscfg and how to trigger the enabling.

Comment 3 pkoz 2019-06-16 12:32:39 UTC
Until the bug is fixed we can resort to this for getting back to linux after a detour to Windows:

# grub2-set-default 0

where 0 means the top entry in the list of the boot options, usually the last linux kernel.

Comment 4 Mirko Predosin 2019-07-05 23:08:12 UTC
I have to say that the GRUB_ENABLE_BLSCFG feature has been a pretty bad experience for me. I have already reported the issue with missing grub entries in Bug 1707199 which has still gotten no attention.  And now I'm running into this issue as well where the last selected boot is not getting saved as the default.

Comment 5 Mirko Predosin 2019-07-27 00:35:46 UTC
This is fixed for me with a recent FC30 upgrade.

Comment 6 pkoz 2019-07-27 17:52:09 UTC
(In reply to Mirko Predosin from comment #5)
> This is fixed for me with a recent FC30 upgrade.

Unfortunately, that's not the case with my FC30.

Could you provide the package list of your upgrade?

PK

Comment 7 jshatch 2019-07-31 00:34:38 UTC
(In reply to Mirko Predosin from comment #5)
> This is fixed for me with a recent FC30 upgrade.

This is not fixed, the behavior for me is the exact same as how I reported it.

Comment 8 Stan King 2019-08-04 18:46:48 UTC
I'm having "grub2-set-default 0" to enforce the default of booting the most recently installed Linux kernel, because it defaults back to Windows 10 every time the kernel is upgraded.  Is this the same bug, or shall I open another?

Comment 9 jshatch 2019-08-06 20:54:41 UTC
I do not experience that behavior, but I have GRUB_SAVEDEFAULT=true and GRUB_DEFAULT=saved commented out while this bug exists to avoid unwanted boots to Windows.  The primary reason why I want to have this work with those options enabled is because of Windows updates - those updates often reboot during the update process and I want it to stay in Windows for that without me babysitting the update.

Comment 10 Mirko Predosin 2019-08-07 03:09:42 UTC
I believe the fix for me was installing the grubby-deprecated package.

More details are explained here:
https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault

Comment 11 jshatch 2019-08-10 14:53:58 UTC
(In reply to Mirko Predosin from comment #10)
> I believe the fix for me was installing the grubby-deprecated package.
> 
> More details are explained here:
> https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault

This did restore the old functionality for me.

This bug is not resolved though, installing a deprecated package (grubby) and disabling BootLoaderSpec is only a temporary band-aid.  To resolve this bug, one of the following must happen:

The functionality from setting GRUB_SAVEDEFAULT must work with BootLoaderSpec and without grubby; or
The functionality from setting GRUB_SAVEDEFAULT must work by removing BootLoaderSpec as the default and continued maintenance of grubby.

Comment 12 Sascha Zorn 2019-09-16 22:41:34 UTC
This also hit me as I also switched my RAID layout with the upgrade to Fedora 30 and the initrd of F29 was not able to boot my system, but after every kernel upgrade, always the last entry (f29 kernel) was selected and broke my reboot! Besides the obvious fix of removing all f29 kernels I also switched off BLS as it always started the OLDEST Kernel instead of the latest, which is not good for many people when thinking about critical kernel fixes or even computers that miss critical security fixes!

Comment 13 Arpan Biswas 2019-11-15 02:28:13 UTC
J

Comment 14 Arpan Biswas 2019-11-15 02:40:11 UTC
Sorry about the last message. It was sent by mistake.

The problem still persists in Fedora 31. I wonder when it would be fixed. For now I have commented out GRUB_ENABLE_BLSCFG=true and running grub2-mkconfig after every kernel update.

Comment 15 jshatch 2019-11-23 03:46:43 UTC
Ok, a recent update changed my /etc/default/grub to forcefully add back GRUB_ENABLE_BLSCFG=true, completely breaking the grub config for the next boot.  Look, I get it, you want to switch to BootLoaderSpec but right now it isn't ready unless it incorporates all of the previous functionality or said functionality is officially deprecated.

Can we get at least a simple acknowledgement that you have seen this bug?

Comment 16 aworlitschek 2019-12-10 15:05:47 UTC
(In reply to Arpan Biswas from comment #14)
Yes, the problem persists. I'm using the same workaround

Comment 17 Javier Martinez Canillas 2019-12-11 08:00:04 UTC
(In reply to jshatch from comment #15)
> Ok, a recent update changed my /etc/default/grub to forcefully add back
> GRUB_ENABLE_BLSCFG=true, completely breaking the grub config for the next
> boot.  Look, I get it, you want to switch to BootLoaderSpec but right now it
> isn't ready unless it incorporates all of the previous functionality or said
> functionality is officially deprecated.
> 
> Can we get at least a simple acknowledgement that you have seen this bug?

Yes, I agree that it's an issue and that GRUB_SAVEDEFAULT=true should be honored with GRUB_ENABLE_BLSCFG=true. I'll try to take a look to this next week.

Comment 18 Fritz Elfert 2020-01-05 01:25:03 UTC
Created attachment 1649822 [details]
Patch which fixes the bug

The attached patch fixes this bug by introducing an optional parameter "savedefault" to the blscfg command. If specified, this adds an invocation of savedefault in all generated entries. The corresponding /etc/grub.d/10_linux then simply adds this parameter if GRUB_SAVEDEFAULT is true. Tested here on fc30.

Comment 19 Fritz Elfert 2020-01-07 08:07:00 UTC
Please review/apply this patch.

Comment 20 Fritz Elfert 2020-01-12 22:49:31 UTC
Created attachment 1651705 [details]
Improved patch for fc30

Attached is an improved patch which fixes the bug.

Note: In order to use the "savedefault" functionality, one *MUST* run *BOTH*
grub2-mkconfig and grub2-install once after upgrading the the grub2 package.

With the old patch, failing to run grub2-install but running grub2-mkconfig leads to an unpopulated (empty) boot menu. In order populate the menu, one must open the grub cmdline and run blscfg without any parameter. The new patch uses a grub environment variable instead of a cmdline parameter. Therefore it is backwards compatible to the unpatched grub and the empty menu case cannot happen anymore.

Cheers
 -Fritz

Comment 21 Fritz Elfert 2020-01-12 22:57:30 UTC
Created attachment 1651706 [details]
Improved patch for fc31 (grub2-1:2.02-104)

The above patch does not apply properly to grub2-1:2.02-104 from fc31.
Therefore, this the proper patch to use with that version.
Functionality is the same.

Cheers
 -Fritz

Comment 22 Javier Martinez Canillas 2020-01-13 09:02:48 UTC
(In reply to Fritz Elfert from comment #20)
> Created attachment 1651705 [details]
> Improved patch for fc30
>
> Attached is an improved patch which fixes the bug.

Thanks a lot for the patch!

[snip]

> must open the grub cmdline and run blscfg without any parameter. The new
> patch uses a grub environment variable instead of a cmdline parameter.
> Therefore it is backwards compatible to the unpatched grub and the empty
> menu case cannot happen anymore.
>

Agreed that an env var is a much better approach. Your change looks good to me, I'll do a build for F30, 31 and Rawhide including your fix today. I'll just rename the env var name to save_default instead of bls_savedefault so it's consistent with the other env vars used by the blscfg module that don't have a bls_ prefix.
 
> Cheers
>  -Fritz

Best regards

Comment 23 Javier Martinez Canillas 2020-01-13 19:12:01 UTC
(In reply to Fritz Elfert from comment #21)
> Created attachment 1651706 [details]
> Improved patch for fc31 (grub2-1:2.02-104)
> 

Thanks again for the patch.

Besides the env var name, I've also changed a little bit so the variable is set in grubenv rather than in the GRUB config file so is consistent with the other variables used by the blscfg module. I've also added a commit message and made you the author of the patch, you can see the resulting here:

https://src.fedoraproject.org/rpms/grub2/c/89bc295877ee

I just did a build for Rawhide and pushed updates for Fedora 30 and 31.

Comment 24 Fritz Elfert 2020-01-13 22:12:33 UTC
Ok guys, fetch the builds, test and give karma here:

For F30: https://bodhi.fedoraproject.org/updates/FEDORA-2020-e3adf88ba7
For F31: https://bodhi.fedoraproject.org/updates/FEDORA-2020-95abadb310

Both look good for me.

Cheers
 -Fritz

Comment 25 Fedora Update System 2020-01-14 01:43:50 UTC
grub2-2.02-105.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-95abadb310

Comment 26 Fedora Update System 2020-01-14 02:48:30 UTC
grub2-2.02-88.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-e3adf88ba7

Comment 27 ghborrmann 2020-01-14 16:06:33 UTC
Behavior has changed, but still is not correct.  After installing from the testing repository and running grub2-mkconfig, nothing changed (as I expected).  After running dnf upgrade to install a new kernel, the behavior changed.  Now the latest kernel is always selected; booting from either an older kernel or an os-prober-generated entry seems to ignore SAVEDEFAULT.  Is there something else I should be doing to make this work?

Comment 28 Javier Martinez Canillas 2020-01-14 17:08:18 UTC
(In reply to ghborrmann from comment #27)
> Behavior has changed, but still is not correct.  After installing from the
> testing repository and running grub2-mkconfig, nothing changed (as I
> expected).  After running dnf upgrade to install a new kernel, the behavior
> changed.  Now the latest kernel is always selected; booting from either an
> older kernel or an os-prober-generated entry seems to ignore SAVEDEFAULT. 
> Is there something else I should be doing to make this work?

It's a legacy BIOS install? If so then you need to run grub2-install as Fritz mentioned.

Comment 29 Fritz Elfert 2020-01-14 17:24:13 UTC
@ghbormann: You missed my note in comment #20:

run:

 grub2-install /dev/WhateverYourBootDeviceIs

Background: There are **two** parts involved:

1. grub2-mkconfig which sets up /boot/grub2/grubenv
2. The actual blscfg new module, which interprets the environment and generates the menuentries.
The latter one gets updated by grub2-install.

Cheers
 -Fritz

Comment 30 Javier Martinez Canillas 2020-01-15 17:05:52 UTC
*** Bug 1708455 has been marked as a duplicate of this bug. ***

Comment 31 ghborrmann 2020-01-16 01:16:57 UTC
grub2-install resulted in an error, apparently because grub2-efi-x64-modules was not installed.  After installing that from testing, I received the following error message: 

    grub2-install: error: efibootmgr failed to register the boot entry: Unknown error 21928.

If this command is run again, it fails identically except that the unknown error number is different.

At this point, I don't know what to do next.  Since grub2-efi-x64-modules was not installed by anaconda, does this mean that grub requires a target of i386-pc instead of x86_64-efi?  I am reluctant to try this, for fear that this could completely destroy my ability to boot.  Any suggestions?

Comment 32 Eric Work 2020-01-16 07:17:35 UTC
I just installed the update then reran grub2-mkconfig and it worked.  I'm also using an EFI system though.

Comment 33 voyde 2020-01-16 09:31:26 UTC
After I installed the testing update and ran grub2-mkconfig savedefault works properly.

My previous custom kernel command line options (set via grubby) were missing after doing this. I reenabled them via grubby without further issue. Was this inherent to the update process, or an unintended side effect?

Comment 34 Javier Martinez Canillas 2020-01-16 10:05:31 UTC
(In reply to ghborrmann from comment #31)
> grub2-install resulted in an error, apparently because grub2-efi-x64-modules
> was not installed.  After installing that from testing, I received the
> following error message: 
> 
>     grub2-install: error: efibootmgr failed to register the boot entry:
> Unknown error 21928.
> 
> If this command is run again, it fails identically except that the unknown
> error number is different.
> 
> At this point, I don't know what to do next.  Since grub2-efi-x64-modules
> was not installed by anaconda, does this mean that grub requires a target of
> i386-pc instead of x86_64-efi?  I am reluctant to try this, for fear that
> this could completely destroy my ability to boot.  Any suggestions?

You should only use grub2-install if you are not using EFI, since for EFI the grub2 binary is updated in the ESP when a new grub2 package is installed.

In the case of EFI you only need to execute grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg to re-generate the GRUB config file.

Comment 35 Javier Martinez Canillas 2020-01-16 10:07:35 UTC
(In reply to voyde from comment #33)
> After I installed the testing update and ran grub2-mkconfig savedefault
> works properly.
> 
> My previous custom kernel command line options (set via grubby) were missing
> after doing this. I reenabled them via grubby without further issue. Was
> this inherent to the update process, or an unintended side effect?

If you want your kernel cmdline changes to persist across grub2-mkconfig invocations, then you need to modify GRUB_CMDLINE_LINUX in /etc/default/grub.

Comment 36 Javier Martinez Canillas 2020-01-28 13:30:06 UTC
*** Bug 1717723 has been marked as a duplicate of this bug. ***

Comment 37 Fedora Update System 2020-01-31 01:12:22 UTC
grub2-2.02-88.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 38 Fedora Update System 2020-01-31 02:00:14 UTC
grub2-2.02-105.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 39 thechexmo 2020-04-04 22:06:36 UTC
I've made a clean Installation of Fedora yesterday and updated all before trying to config anything.
Then i tried to customize GRUB.
It seems like this bug still happens.

This bugfix seems like it doesn't work.
https://bodhi.fedoraproject.org/updates/FEDORA-2020-95abadb310

If BootLoaderSpec is the problem, do you know any workaraound to make Fedora use a non-BootLoaderSpec way?.

Here is kind of workaraound using grubby-deprecated libraries.
https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault#Upgrade.2Fcompatibility_impact

Comment 40 thechexmo 2020-04-04 23:17:36 UTC
(In reply to thechexmo from comment #39)
> Here is kind of workaraound using grubby-deprecated libraries.
> https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault#Upgrade.
> 2Fcompatibility_impact


That lastly broke my grub and i can't repair it.
I had to boot using a booteable usb tool, but grub2-mkconfig saves something but then grub doesn't work. Grub-install gives me an error about a .sh file missing.

Comment 41 Javier Martinez Canillas 2020-04-05 09:31:35 UTC
(In reply to thechexmo from comment #39)
> I've made a clean Installation of Fedora yesterday and updated all before
> trying to config anything.
> Then i tried to customize GRUB.
> It seems like this bug still happens.
> 
> This bugfix seems like it doesn't work.
> https://bodhi.fedoraproject.org/updates/FEDORA-2020-95abadb310
>

Which Fedora version did you install? Also, is this an EFI or legacy BIOS install?

I assume that you installed Fedora, then added GRUB_SAVEDEFAULT=true to /etc/default/grub and finally re-generated your GRUB config with grub2-mkconfig but GRUB doesn't save as default your last booted entry?

Could you please share the following files:

/boot/grub2/grubnev
/boot/grub2/grub.cfg if your install is a legacy BIOS or /boot/efi/EFI/fedora/grub.cfg if your install is EFI.
/etc/default/grub
/boot/loader/entries/*.conf
 
> If BootLoaderSpec is the problem, do you know any workaraound to make Fedora
> use a non-BootLoaderSpec way?.
> 
> Here is kind of workaraound using grubby-deprecated libraries.
> https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault#Upgrade.
> 2Fcompatibility_impact


Yes, setting GRUB_ENABLE_BLSCFG=false and re-generating your GRUB config file. But in that case you need to install the grubby-deprecated package.

Comment 42 Javier Martinez Canillas 2020-04-05 09:32:55 UTC
(In reply to thechexmo from comment #40)
> (In reply to thechexmo from comment #39)
> > Here is kind of workaraound using grubby-deprecated libraries.
> > https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault#Upgrade.
> > 2Fcompatibility_impact
> 
> 
> That lastly broke my grub and i can't repair it.
> I had to boot using a booteable usb tool, but grub2-mkconfig saves something
> but then grub doesn't work. Grub-install gives me an error about a .sh file
> missing.

Could you please be more specific on what break? If you have an EFI install then you shouldn't execute grub2-install.

Comment 43 Garrett Mitchener 2020-06-04 21:08:44 UTC
I'm still seeing problems.
Fedora 32, EFI, 64 bit, multiple machines.

grub2-common-2.04-19.fc32.noarch
grub2-efi-x64-2.04-19.fc32.x86_64
grubby-8.40-40.fc32.x86_64
grub2-tools-2.04-19.fc32.x86_64
grub2-tools-extra-2.04-19.fc32.x86_64
grub2-pc-modules-2.04-19.fc32.noarch
grub2-tools-minimal-2.04-19.fc32.x86_64
grub2-efi-x64-cdboot-2.04-19.fc32.x86_64
grub2-starfield-theme-2.02-0.40.fc26.x86_64
grub2-tools-efi-2.04-19.fc32.x86_64
grub2-pc-2.04-19.fc32.

in /etc/default/grub:

GRUB_DEFAULT="saved"
GRUB_SAVEDEFAULT="true"
GRUB_DISABLE_SUBMENU="true"
GRUB_DISABLE_RECOVERY="false"
GRUB_ENABLE_BLSCFG=true


I re-ran grub2-mkconfig and grub2-editenv to clear everything out.

But here's the problem: Once I boot into Windows once, no matter what I boot into later, the default in the environment file stays stuck on that Windows option:

# grub2-editenv list
boot_success=1
boot_indeterminate=0
saved_entry=osprober-efi-E226-CF46

That last saved_entry is the Windows boot loader.
So I have to re-set the grub2 environment file, or it boots into Windows by default even after I boot into Linux again.
I see this behavior on two different machines.
Both were upgraded from Fedora 31.

Comment 44 Javier Martinez Canillas 2020-06-04 21:53:26 UTC
(In reply to Garrett Mitchener from comment #43)

[snip]

> 
> in /etc/default/grub:
> 
> GRUB_DEFAULT="saved"
> GRUB_SAVEDEFAULT="true"
> GRUB_DISABLE_SUBMENU="true"
> GRUB_DISABLE_RECOVERY="false"
> GRUB_ENABLE_BLSCFG=true
> 
> 
> I re-ran grub2-mkconfig and grub2-editenv to clear everything out.
>
> But here's the problem: Once I boot into Windows once, no matter what I boot
> into later, the default in the environment file stays stuck on that Windows
> option:
> 
> # grub2-editenv list
> boot_success=1
> boot_indeterminate=0
> saved_entry=osprober-efi-E226-CF46
>

I think that's the problem, when GRUB_SAVEDEFAULT="true" in /etc/default/grub, grub2-mkconfig sets a save_default=true in /boot/grub2/grubenv. That variable is used by the blscfg module to know if the linux boot entries have to be set as the default when chosen.

Can you please try running grub2-mkconfig and not clear your grubenv after that? Otherwise that variable won't be set. You can also fix it by doing grub2-editenv - set save_default=true

Comment 45 Garrett Mitchener 2020-06-16 01:03:23 UTC
I can't make it work no matter what I do.
I've run every permutation of grub2-mkconfig and grub2-editenv and it just won't work.
Currently I have the opposite problem. When I boot into Windows, it doesn't remember and it defaults back to Linux the next time.

Here's /etc/default/grub:

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="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 resume=/dev/mapper/fedora_localhost--live-swap rd.lvm.lv=fedora_localhost-live/root rd.lvm.lv=fedora_localhost-live/swap rhgb quiet"
#GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

Here's /boot/grub2/grubenv:

# GRUB Environment Block
kernelopts=root=/dev/mapper/fedora_localhost--live-root ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 resume=/dev/mapper/fedora_localhost--live-swap rd.lvm.lv=fedora_localhost-live/root rd.lvm.lv=fedora_localhost-live/swap rhgb quiet 
save_default=true
boot_success=0
boot_indeterminate=0
saved_entry=426b2d6b4ed64df2bded8a8967196ecd-5.6.16-300.fc32.x86_64
###...

Comment 46 Javier Martinez Canillas 2020-06-16 08:10:26 UTC
(In reply to Garrett Mitchener from comment #45)
> I can't make it work no matter what I do.
> I've run every permutation of grub2-mkconfig and grub2-editenv and it just
> won't work.
> Currently I have the opposite problem. When I boot into Windows, it doesn't
> remember and it defaults back to Linux the next time.
> 
> Here's /etc/default/grub:
> 
> 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="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau
> nvidia-drm.modeset=1 resume=/dev/mapper/fedora_localhost--live-swap
> rd.lvm.lv=fedora_localhost-live/root rd.lvm.lv=fedora_localhost-live/swap
> rhgb quiet"
> #GRUB_DISABLE_RECOVERY="true"
> GRUB_ENABLE_BLSCFG=true
> 

You are missing GRUB_SAVEDEFAULT=true in your /etc/default/grub.

Add that and re-generate your grub.cfg and it should work.

Comment 47 Garrett Mitchener 2020-06-21 01:56:20 UTC
Okay, I think I've got everything set in all the right places and it seems to finally be working. Thanks!