Merge lp:~broder/ubuntu/natty/grub2/no-if-in-menuentry into lp:~ubuntu-core-dev/ubuntu/natty/grub2/natty

Proposed by Evan Broder
Status: Merged
Merged at revision: 2077
Proposed branch: lp:~broder/ubuntu/natty/grub2/no-if-in-menuentry
Merge into: lp:~ubuntu-core-dev/ubuntu/natty/grub2/natty
Diff against target: 51 lines (+10/-3)
2 files modified
debian/changelog (+7/-0)
debian/patches/ubuntu_gfxpayload_filter.patch (+3/-3)
To merge this branch: bzr merge lp:~broder/ubuntu/natty/grub2/no-if-in-menuentry
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+42200@code.launchpad.net

This proposal supersedes a proposal from 2010-11-29.

Description of the change

Older versions of GRUB [1] don't allow for if statements within menuentry blocks. They throw an error when they encounter one. If you don't have the grub-pc/install_devices debconf field set (such that GRUB isn't re-installed when it's upgraded), this can lead to an unbootable system when combined with the recent gfxpayload changes.

While you certainly *shouldn't* have grub-pc/install_devices set in the first place, it's easy to make our configuration resilient to this possibility.

[1] Definitely 1.98-1ubuntu1, which I realize is crazy ancient. Don't know when the feature was added.

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

What about the case where they've explicitly set GRUB_GFXPAYLOAD_LINUX=keep? That needs to call load_video too, I think.

review: Needs Fixing
Revision history for this message
Colin Watson (cjwatson) wrote :

Better now, thanks. I noticed the sense of the check was backwards (= "text" rather than != "text") and corrected that. Merged!

Revision history for this message
Colin Watson (cjwatson) :
review: Approve

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 2010-11-26 14:38:40 +0000
3+++ debian/changelog 2010-11-30 02:52:17 +0000
4@@ -1,3 +1,10 @@
5+grub2 (1.99~20101126-1ubuntu2) natty; urgency=low
6+
7+ * Simplify the auto-generated menu entries for Linux to avoid using
8+ syntax not supported by older GRUB releases.
9+
10+ -- Evan Broder <evan@ebroder.net> Sun, 28 Nov 2010 16:29:35 -0800
11+
12 grub2 (1.99~20101126-1ubuntu1) natty; urgency=low
13
14 * Resynchronise with Debian experimental. Remaining changes:
15
16=== modified file 'debian/patches/ubuntu_gfxpayload_filter.patch'
17--- debian/patches/ubuntu_gfxpayload_filter.patch 2010-11-24 13:57:30 +0000
18+++ debian/patches/ubuntu_gfxpayload_filter.patch 2010-11-30 02:52:17 +0000
19@@ -7,7 +7,7 @@
20 ===================================================================
21 --- a/util/grub.d/10_linux.in
22 +++ b/util/grub.d/10_linux.in
23-@@ -80,18 +80,10 @@
24+@@ -80,18 +80,9 @@
25 save_default_entry | sed -e "s/^/\t/"
26 fi
27
28@@ -22,14 +22,13 @@
29 - cat << EOF
30 - set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
31 + cat << EOF
32-+ if [ "\$linux_gfx_mode" != text ]; then load_video; fi
33 + set gfxpayload=\$linux_gfx_mode
34 EOF
35 - fi
36
37 if [ -z "${prepare_boot_cache}" ]; then
38 prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
39-@@ -125,6 +117,30 @@
40+@@ -125,6 +116,31 @@
41 done`
42 prepare_boot_cache=
43
44@@ -56,6 +55,7 @@
45 +fi
46 +EOF
47 +fi
48++echo 'if [ "$linux_gfx_mode" = "text" ]; then load_video; fi'
49 +
50 while [ "x$list" != "x" ] ; do
51 linux=`version_find_latest $list`

Subscribers

People subscribed via source and target branches