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
=== modified file 'debian/changelog'
--- debian/changelog 2010-11-26 14:38:40 +0000
+++ debian/changelog 2010-11-30 02:52:17 +0000
@@ -1,3 +1,10 @@
1grub2 (1.99~20101126-1ubuntu2) natty; urgency=low
2
3 * Simplify the auto-generated menu entries for Linux to avoid using
4 syntax not supported by older GRUB releases.
5
6 -- Evan Broder <evan@ebroder.net> Sun, 28 Nov 2010 16:29:35 -0800
7
1grub2 (1.99~20101126-1ubuntu1) natty; urgency=low8grub2 (1.99~20101126-1ubuntu1) natty; urgency=low
29
3 * Resynchronise with Debian experimental. Remaining changes:10 * Resynchronise with Debian experimental. Remaining changes:
411
=== modified file 'debian/patches/ubuntu_gfxpayload_filter.patch'
--- debian/patches/ubuntu_gfxpayload_filter.patch 2010-11-24 13:57:30 +0000
+++ debian/patches/ubuntu_gfxpayload_filter.patch 2010-11-30 02:52:17 +0000
@@ -7,7 +7,7 @@
7===================================================================7===================================================================
8--- a/util/grub.d/10_linux.in8--- a/util/grub.d/10_linux.in
9+++ b/util/grub.d/10_linux.in9+++ b/util/grub.d/10_linux.in
10@@ -80,18 +80,10 @@10@@ -80,18 +80,9 @@
11 save_default_entry | sed -e "s/^/\t/"11 save_default_entry | sed -e "s/^/\t/"
12 fi12 fi
13 13
@@ -22,14 +22,13 @@
22- cat << EOF22- cat << EOF
23- set gfxpayload=$GRUB_GFXPAYLOAD_LINUX23- set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
24+ cat << EOF24+ cat << EOF
25+ if [ "\$linux_gfx_mode" != text ]; then load_video; fi
26+ set gfxpayload=\$linux_gfx_mode25+ set gfxpayload=\$linux_gfx_mode
27 EOF26 EOF
28- fi27- fi
29 28
30 if [ -z "${prepare_boot_cache}" ]; then29 if [ -z "${prepare_boot_cache}" ]; then
31 prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"30 prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
32@@ -125,6 +117,30 @@31@@ -125,6 +116,31 @@
33 done`32 done`
34 prepare_boot_cache=33 prepare_boot_cache=
35 34
@@ -56,6 +55,7 @@
56+fi55+fi
57+EOF56+EOF
58+fi57+fi
58+echo 'if [ "$linux_gfx_mode" = "text" ]; then load_video; fi'
59+59+
60 while [ "x$list" != "x" ] ; do60 while [ "x$list" != "x" ] ; do
61 linux=`version_find_latest $list`61 linux=`version_find_latest $list`

Subscribers

People subscribed via source and target branches