Merge lp:~darkmuggle/ubuntu/quantal/grub2/param-recordfail-timeout into lp:ubuntu/quantal/grub2

Proposed by Ben Howard on 2012-05-24
Status: Merged
Merge reported by: Colin Watson
Merged at revision: not available
Proposed branch: lp:~darkmuggle/ubuntu/quantal/grub2/param-recordfail-timeout
Merge into: lp:ubuntu/quantal/grub2
Diff against target: 76 lines (+54/-0)
3 files modified
debian/changelog (+9/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu_param_recordfail_timeout.patch (+44/-0)
To merge this branch: bzr merge lp:~darkmuggle/ubuntu/quantal/grub2/param-recordfail-timeout
Reviewer Review Type Date Requested Status
Colin Watson 2012-05-24 Approve on 2012-05-30
Review via email:

This proposal supersedes a proposal from 2012-05-21.

Description of the change

This patch parameterizes the record fail behavior, such that putting "GRUB_RECORDFAIL_TIMEOUT=0" in /etc/default/grub will fix hang problems on appliances and HVM cloud images. (See LP: #462888, #872244, #447725 and #669481 and there are many user reports on Google). The current work-around is to modify /etc/grub.d/00_header directly. However, this work around fails on any Grub2 package update.

This fix simply adds the environment variable "GRUB_RECORDFAIL_TIMEOUT" which can then be defined in /etc/default/grub. When this variable is present, it sets the timeout on "recordfail" to the value, otherwise it sets it the default value of "-1".

This has been tested on both Precise and Quantal builds.

To post a comment you must log in.
Colin Watson (cjwatson) wrote : Posted in a previous version of this proposal

Please drop the debian/default/grub change. It'll probably cause configuration file prompts for people, and it's unnecessary - most variables are not documented by way of comments in the stock /etc/default/grub file.

Conversely, please add a patch to docs/grub.texi to document this new variable.

review: Needs Fixing
Colin Watson (cjwatson) wrote : Posted in a previous version of this proposal

Oh, also, a more verbose changelog entry (along the lines of your commit message) wouldn't hurt.

Ben Howard (darkmuggle) wrote :

Resubmission with requested changes.

Ben Howard (darkmuggle) wrote :

Launchpad is not updating the revison number. The current revision is 145.

Ben Howard (darkmuggle) wrote :


Colin Watson (cjwatson) wrote :

The GRUB_RECORDFAIL_TIMEOUT block is one line off where it should be in grub.texi; I'll fix that up. I think I'll also consolidate this into ubuntu_failed_boot_menu.patch; there's little point in carrying two patches in the series when the whole recordfail business is an Ubuntu patch to begin with.

Otherwise this looks good, thanks!

review: Approve
Colin Watson (cjwatson) wrote :

Argh. This branch is incorrectly based on lp:ubuntu/grub2 rather than on lp:~ubuntu-core-dev/ubuntu/quantal/grub2/quantal (sorry for these being different), so I cannot merge it directly due to them sharing no history. I'll just have to apply the patch directly.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-05-15 08:03:30 +0000
3+++ debian/changelog 2012-05-24 20:17:25 +0000
4@@ -1,3 +1,12 @@
5+grub2 (1.99-21ubuntu5) UNRELEASED; urgency=low
7+ * Parameterization of recordfail setting. This allows users to define the
8+ default time out of GRUB when recordfail has been set. The current
9+ setting causes hangs on headless and appliances where access to the
10+ console is limited or prohibited. (LP: #669481)
12+ -- Ben Howard <> Thu, 24 May 2012 10:27:43 -0600
14 grub2 (1.99-21ubuntu4) quantal; urgency=low
16 * Switch to backwards compatible ${} syntax for grub.cfg (LP: #978464)
18=== modified file 'debian/patches/series'
19--- debian/patches/series 2012-04-17 16:11:45 +0000
20+++ debian/patches/series 2012-05-24 20:17:25 +0000
21@@ -64,3 +64,4 @@
22 ubuntu_qemu_no_kvm.patch
23 ubuntu_probe_nonexistent_loopback.patch
24 ubuntu_efi_device_discovery.patch
27=== added file 'debian/patches/ubuntu_param_recordfail_timeout.patch'
28--- debian/patches/ubuntu_param_recordfail_timeout.patch 1970-01-01 00:00:00 +0000
29+++ debian/patches/ubuntu_param_recordfail_timeout.patch 2012-05-24 20:17:25 +0000
30@@ -0,0 +1,44 @@
31+Description: Parameterizes the timeout value for recordfail boots
32+Author: Ben Howard <>
34+Forwarded: no
35+Last-Update: 2012-05-17
37+--- a/util/grub.d/
38++++ b/util/grub.d/
39+@@ -233,7 +233,7 @@ make_timeout ()
40+ {
41+ cat << EOF
42+ if [ "\${recordfail}" = 1 ]; then
43+- set timeout=-1
44++ set timeout=${GRUB_RECORDFAIL_TIMEOUT:--1}
45+ else
46+ set timeout=${2}
47+ fi
48+--- a/util/
49++++ b/util/
50+@@ -245,7 +245,8 @@ export GRUB_DEFAULT \
58+ if test "x${grub_cfg}" != "x"; then
59+ rm -f ${grub_cfg}.new
60+--- a/docs/grub.texi
61++++ b/docs/grub.texi
62+@@ -1249,6 +1249,12 @@ out specified regions of RAM.
64+ This option may be set to a list of GRUB module names separated by spaces.
65+ Each module will be loaded as early as possible, at the start of
68++If this option is set, it overrides the default recordfail setting. The
69++default setting is -1, which causes GRUB to wait for user input. This option
70++should be set on headless and appliance systems where access to a console is
71++restricted or limited.
72+ @file{grub.cfg}.
74+ @end table
76=== removed file 'grub-core/lib/posix_wrap/limits.h'


People subscribed via source and target branches

to all changes: