Bug 1159887

Summary: [y2-bootloader] Remember last choice in grub
Product: [openSUSE] openSUSE Tumbleweed Reporter: Terry Cater <tjcater>
Component: YaST2Assignee: YaST Team <yast-internal>
Status: CONFIRMED --- QA Contact: Jiri Srain <jsrain>
Severity: Enhancement    
Priority: P5 - None CC: ancor, claudius.ellsel, jreidinger, mchang
Version: Current   
Target Milestone: ---   
Hardware: All   
OS: Other   
URL: https://trello.com/c/izFMnlAd
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Terry Cater 2019-12-30 00:13:40 UTC
A toggle for remembering last used OS for grub in yast would lower the paper cuts for dual booters who like this kind of behavior. Perhaps this could be an entry under "Default Boot Selection" in the Bootloader Options menu?
Comment 1 Josef Reidinger 2019-12-30 08:20:22 UTC
that make sense for me.

Michael - just quick question, how to reset already set value that we set by "grub-set-default" to use really the last one?
Comment 2 Michael Chang 2020-01-03 10:25:36 UTC
(In reply to Josef Reidinger from comment #1)
> that make sense for me.
> 
> Michael - just quick question, how to reset already set value that we set by
> "grub-set-default" to use really the last one?

I believed the simple configuration [1] GRUB_SAVEDEFAULT is what you are looking for. And if you read the manual thoroughly, you'll see the caveat in the end. 

"This option relies on the environment block, which may not be available in all situations"

That is also saying we may have to detect either of the zfs, lvm and mdadm is in use by /boot and pop up warning whenever writable environment block not available.

[1] https://www.gnu.org/software/grub/manual/grub/grub.html#Simple-configuration

Thanks.
Comment 3 Josef Reidinger 2020-01-03 10:41:17 UTC
(In reply to Michael Chang from comment #2)
> (In reply to Josef Reidinger from comment #1)
> > that make sense for me.
> > 
> > Michael - just quick question, how to reset already set value that we set by
> > "grub-set-default" to use really the last one?
> 
> I believed the simple configuration [1] GRUB_SAVEDEFAULT is what you are
> looking for. And if you read the manual thoroughly, you'll see the caveat in
> the end. 
> 
> "This option relies on the environment block, which may not be available in
> all situations"
> 
> That is also saying we may have to detect either of the zfs, lvm and mdadm
> is in use by /boot and pop up warning whenever writable environment block
> not available.
> 
> [1]
> https://www.gnu.org/software/grub/manual/grub/grub.html#Simple-configuration
> 
> Thanks.

ah, fine so if we use GRUB_DEFAULT=saved and GRUB_SAVEDEFAULT='true'
then "grub-set-default" value is ignored, right? And if that environment block is not available it will use that default instead?
Comment 4 Michael Chang 2020-01-03 11:06:16 UTC
(In reply to Josef Reidinger from comment #3)
> (In reply to Michael Chang from comment #2)
> > (In reply to Josef Reidinger from comment #1)

> 
> ah, fine so if we use GRUB_DEFAULT=saved and GRUB_SAVEDEFAULT='true'
> then "grub-set-default" value is ignored, right?

Strictly speaking grub-set-default is not ignored, it could still be used to set "last default" from linux, besides from grub. :)

> And if that environment
> block is not available it will use that default instead?

Yes I think so. But grub will also spew ugly warnings (rather clueless like "sparse file not allowed") in this case. :(
Comment 5 Claudius Ellsel 2020-12-01 15:49:30 UTC
I'd like to see this behavior activated by default. Are there reasons against it?

Some distributions like Ubuntu don't have it on, but I really enjoy this option on Manjaro for example where it is on by default.