[Bug 905271] [NEW] update-grub generates syntax error when in_submenu=true in 10_linux

rhhoek r.h.hoek at utwente.nl
Fri Dec 16 11:08:03 UTC 2011


Public bug reported:

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

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386 oneiric

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/905271

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

Status in “grub2” package in Ubuntu:
  New

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/905271/+subscriptions




More information about the foundations-bugs mailing list