update-grub generates syntax error when in_submenu=true in 10_linux

Bug #905271 reported by rhhoek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Because I wanted to boot my system with different kernels I needed to switch-off the submenu's in the grubmenu. (You cannot select a kernel to boot when it's in a submenu (GRUB_DEFAULT in /etc/defaults/grub))

To switch off submenu's I changed 'in_submenu=true' in /etc/grub.d/10_linux
After running /usr/sbin/update-grub I got this error:

# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.0.0-13-generic-pae
Found initrd image: /boot/initrd.img-3.0.0-13-generic-pae
Found linux image: /boot/vmlinuz-2.6.36-020636-generic
Found initrd image: /boot/initrd.img-2.6.36-020636-generic
Found memtest86+ image: /memtest86+.bin
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 137
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done

An '}' is added even if there is no submenu. (see attachment grub.cfg.new)

I have patched 10_linux. The problem is (I think) that the variable 'in_submenu' is used twice for different functions. I also changed the meaning of in_submenu. When it's true it means a submenu are used, false means no submenu.

 diff 10_linux_changed /etc/grub.d/10_linux
186,191c186
< in_submenu=false
< #in_submenu=true
< in_submenu_close=false
< if ! $in_submenu ; then
< echo "Generating config without submenu" >&2
< fi
---
> in_submenu=true
251c246
< if [ "$list" ] && $in_submenu; then
---
> if [ "$list" ] && ! $in_submenu; then
253c248
< in_submenu_close=true
---
> in_submenu=:
257,258c252,253
< if $in_submenu_close ; then
< echo "} # close submenu"
---
> if $in_submenu; then
> echo "}"

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: grub-common 1.99-12ubuntu5
Uname: Linux 2.6.36-020636-generic i686
ApportVersion: 1.23-0ubuntu4
Architecture: i386
Date: Fri Dec 16 11:35:21 2011
InstallationMedia: Ubuntu-Server 11.10 "Oneiric Ocelot" - Release i386 (20111011)
ProcEnviron:
 LANGUAGE=en_US:en
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.grub.d.10.linux: 2011-12-16T10:44:16.264215

Revision history for this message
rhhoek (r-h-hoek) wrote :
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in grub2 (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for grub2 (Ubuntu) because there has been no activity for 60 days.]

Changed in grub2 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.