Bug 760841

Summary: grub2 does not correctly handle GRUB_HIDDEN_TIMEOUT
Product: [Fedora] Fedora Reporter: Joseph D. Wagner <joe>
Component: grub2Assignee: Peter Jones <pjones>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: dennis, mads, pjones, vserbine
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-02 14:50:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Joseph D. Wagner 2011-12-07 05:11:49 UTC
Description of problem:
If you set GRUB_HIDDEN_TIMEOUT in /etc/default/grub, grub2-mkconfig produces code which looks like this:

if sleep --interruptible <GRUB_HIDDEN_TIMEOUT> ; then
  set timeout=<GRUB_TIMEOUT>
fi

Actual results:
This codes waits <GRUB_HIDDEN_TIMEOUT> seconds for a key to be pressed, after which it drops the user to the regular boot menu with a <GRUB_TIMEOUT> second timeout.

Expected results:
Documentation says:
Wait this many seconds for a key to be pressed before displaying the menu. **If no key is pressed during that time, boot immediately.**

Version-Release number of selected component (if applicable):
grub2-1.99-12.fc16.x86_64
grubby-8.3-1.fc16.x86_64

How reproducible:
Always

Additional info:
Instead, the code produced should look more like this:

if sleep --interruptible <GRUB_HIDDEN_TIMEOUT> ; then
  set timeout=0
else
  set timeout=<GRUB_TIMEOUT>
fi

Comment 1 Mads Kiilerich 2012-04-16 22:36:26 UTC
Yes, this seems a bit odd, but if you also set GRUB_TIMEOUT=0 then it seems to work just fine.

Comment 2 Joseph D. Wagner 2012-04-16 23:07:52 UTC
There's nothing in doc to indicate these values are interdependent.

Also doc says "Set to '0' to boot immediately without displaying the menu."  Hence, I can't see how this is designed to be the correct action.

I believe this behavior is unintended, and not by design.

Comment 3 Vladimir Serbinenko 2012-06-02 14:48:06 UTC
The documentation was updated upstream. It was also discussed there and it was decided that while this behaviour was slightly unintuitive, it's not bad enough to justify breaking compatibility.