update-grub generates syntax error when in_submenu=true in 10_linux
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/
To switch off submenu's I changed 'in_submenu=true' in /etc/grub.
After running /usr/sbin/
# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
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/
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.
186,191c186
< in_submenu=false
< #in_submenu=true
< in_submenu_
< 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_
---
> 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-
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.
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.