Bug 2001885

Summary: Boot menu is always displayed
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: grub2Assignee: Javier Martinez Canillas <fmartine>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fmartine, hdegoede, kparal, lkundrak, mcatanza, pgnet.dev, pjones, rharwood
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-21 20:25:10 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:

Description Vít Ondruch 2021-09-07 11:34:01 UTC
Description of problem:
If I am not mistaken, boot menu should be displayed just in case of troubles, but mine is displayed every time.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
Boot menu is always displayed


Expected results:
Boot menu is displayed just in case of troubles


Additional info:

~~~
$ sudo grub2-editenv - list
boot_success=1
boot_indeterminate=0
saved_entry=ec300db9bfdf4776bc07b7f4281374a5-5.14.1-300.fc35.x86_64

$ uname -a
Linux localhost.localdomain 5.14.1-300.fc35.x86_64 #1 SMP Fri Sep 3 16:27:33 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
~~~

Comment 1 Hans de Goede 2021-09-08 07:21:15 UTC
On the list you provided the following "sudo grub2-editenv - list" output:

~~~
$ sudo grub2-editenv - list
boot_success=1
boot_indeterminate=0
saved_entry=ec300db9bfdf4776bc07b7f4281374a5-5.14.1-300.fc35.x86_64

$ uname -a
Linux localhost.localdomain 5.14.1-300.fc35.x86_64 #1 SMP Fri Sep 3 16:27:33 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
~~~

For some reason this is missing the "menu_auto_hide=1" setting.

You can fix this by running:

sudo grub2-editenv - set menu_auto_hide=1

The question is why anaconda did not do this though. How did you install
this system?

Comment 2 Vít Ondruch 2021-09-08 10:52:38 UTC
(In reply to Hans de Goede from comment #1)
> The question is why anaconda did not do this though. How did you install
> this system?

I don't think this is fault of anaconda. This used to work AFAIR but just stopped working ~1 month ago?

Comment 3 Vít Ondruch 2021-09-08 10:54:26 UTC
Actually I have different system which I installed at the same time the same way and the `menu_auto_hide=1` is there:

~~~
$ sudo grub2-editenv - list
saved_entry=3119b9bfac624156b3b5c4d395cbb2b4-5.11.0-155.fc35.x86_64
menu_auto_hide=1
boot_success=1
boot_indeterminate=0
~~~

Comment 4 Hans de Goede 2021-09-08 12:12:24 UTC
(In reply to Vít Ondruch from comment #2)
> (In reply to Hans de Goede from comment #1)
> > The question is why anaconda did not do this though. How did you install
> > this system?
> 
> I don't think this is fault of anaconda. This used to work AFAIR but just
> stopped working ~1 month ago?

So you say this stopped working after a package upgrade? Did you perhaps go from Fedora 33 -> F35/rawhide in one go?

The grubenv on EFI systems used to be in /boot/efi/EFI/fedora/grubenv and was moved to /boot/grub2/grubenv to unify the location with BIOS installs. I wonder if the migration script for this failed to move grubenv, so you ended up with a new empty grubenv ?

Comment 5 Hans de Goede 2021-09-08 12:12:56 UTC
p.s. can you confirm that re-adding the menu_auto_hide=1 to grubenv fixes this?

Comment 6 Vít Ondruch 2021-09-08 15:29:20 UTC
(In reply to Hans de Goede from comment #4)
> So you say this stopped working after a package upgrade?

Yes

> Did you perhaps go
> from Fedora 33 -> F35/rawhide in one go?

No. The system have always been Rawhide, it was installed on 2020-11-06 and then semi-regularly kept updated.

> The grubenv on EFI systems used to be in /boot/efi/EFI/fedora/grubenv and
> was moved to /boot/grub2/grubenv to unify the location with BIOS installs. I
> wonder if the migration script for this failed to move grubenv, so you ended
> up with a new empty grubenv ?

Hm, there were probably some hiccups such as system crashes during the update along the way. Unfortunately, I don't remember where exactly it started to happen, but I don't think it was in any relation to such hiccup (the last big hiccup I can find in the DNF history was in April and this started to happen much later AFAIK).

> p.s. can you confirm that re-adding the menu_auto_hide=1 to grubenv fixes this?

I'll try that later.

Thx a lot for looking into this.

Comment 7 Kamil Páral 2021-09-09 08:42:05 UTC
Hans, menu_auto_hide option is only added when you install the system from Fedora Workstation Live ISO. If you install it from netinst ISO, even though you select Fedora Workstation package set, the option is then missing from grub (I tested it right now with latest F35 images). Anaconda clearly only applies that adjustment for Workstation Live image. I don't know if this explains why Vít is affected, but it can explain many other people affected. I wanted to report this for a long time but haven't found the time :-/ Anyone willing to create a new bug against anaconda?

Comment 8 Vít Ondruch 2021-09-09 11:39:10 UTC
(In reply to Kamil Páral from comment #7)
> Hans, menu_auto_hide option is only added when you install the system from
> Fedora Workstation Live ISO.

I have used ISO AFAIK.

> If you install it from netinst ISO, even though
> you select Fedora Workstation package set, the option is then missing from
> grub (I tested it right now with latest F35 images). Anaconda clearly only
> applies that adjustment for Workstation Live image. I don't know if this
> explains why Vít is affected, but it can explain many other people affected.
> I wanted to report this for a long time but haven't found the time :-/
> Anyone willing to create a new bug against anaconda?

But should this option be handled by Anaconda if it is not user settings but Fedora default? Maybe some default option value in Grub should be flipped for Fedora and users should use `menu_auto_hide=0` if they wish to diverge from default.

Comment 9 Hans de Goede 2021-09-09 12:39:50 UTC
(In reply to Kamil Páral from comment #7)
> Hans, menu_auto_hide option is only added when you install the system from
> Fedora Workstation Live ISO. If you install it from netinst ISO, even though
> you select Fedora Workstation package set, the option is then missing from
> grub (I tested it right now with latest F35 images). Anaconda clearly only
> applies that adjustment for Workstation Live image. I don't know if this
> explains why Vít is affected, but it can explain many other people affected.
> I wanted to report this for a long time but haven't found the time :-/
> Anyone willing to create a new bug against anaconda?

Which type of install did you pick? The menu is only auto-hidden for Workstation type installs. For other installs it is deliberately not hidden, see:

https://github.com/rhinstaller/anaconda/blob/master/data/profile.d/fedora-workstation.conf

Which contains:

```
[Bootloader]
menu_auto_hide = True
```

Which the other other installation profiles lack.

(In reply to Vít Ondruch from comment #8)
> But should this option be handled by Anaconda if it is not user settings but
> Fedora default? Maybe some default option value in Grub should be flipped
> for Fedora and users should use `menu_auto_hide=0` if they wish to diverge
> from default.

See my answer to Kamil.

Comment 10 Kamil Páral 2021-09-09 12:49:57 UTC
(In reply to Hans de Goede from comment #9)
> Which type of install did you pick? 

I booted the netinst and selected "Fedora Workstation" environment in Software selection.

> The menu is only auto-hidden for
> Workstation type installs. For other installs it is deliberately not hidden,

I understand. It seems that anaconda doesn't apply that profile, if you boot from netinst and select Fedora Workstation to install.

If Vít used Live and not netinst, then that's a different problem.

Comment 11 Hans de Goede 2021-09-09 13:01:33 UTC
(In reply to Kamil Páral from comment #10)
> (In reply to Hans de Goede from comment #9)
> > Which type of install did you pick? 
> 
> I booted the netinst and selected "Fedora Workstation" environment in
> Software selection.

Ok, if you did that and menu_auto_hide=1 is not present in the grubenv then that indeed is an anaconda bug, please file a bug against anaconda for this.

Comment 12 Kamil Páral 2021-09-09 13:22:13 UTC
(In reply to Hans de Goede from comment #11)
> Ok, if you did that and menu_auto_hide=1 is not present in the grubenv then
> that indeed is an anaconda bug, please file a bug against anaconda for this.

Filed bug 2002668.

Comment 13 Vít Ondruch 2021-09-20 20:24:28 UTC
(In reply to Vít Ondruch from comment #6)
> (In reply to Hans de Goede from comment #4)
> > p.s. can you confirm that re-adding the menu_auto_hide=1 to grubenv fixes this?
> 
> I'll try that later.

This fixes the issue.

Comment 14 Robbie Harwood 2021-09-21 20:25:10 UTC
Thanks.  In that case I think we can close this.

*** This bug has been marked as a duplicate of bug 2002668 ***

Comment 15 Vít Ondruch 2021-09-22 09:48:53 UTC
(In reply to Robbie Harwood from comment #14)
> Thanks.  In that case I think we can close this.


But we still don't know how that happened :(