Ubuntu

update-grub generates illegal directive in grub.cfg

Reported by traderbam@yahoo.co.uk on 2011-08-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Medium
Colin Watson

Bug Description

Grub 1.99 in Ubuntu 11.04 32-bit desktop. "update-grub" produces this stanza in grub.cfg. The set root line is illegal - presumably it should be "set root='(hd0,1)'

menuentry 'Ubuntu, with Linux 2.6.38-8-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set=root cb4ea337-c67e-4d75-b9fc-7ef2dc864fd0
    linux /vmlinuz-2.6.38-8-generic root=UUID=54d78a76-aabc-4886-82a0-7019e8ae731d ro quiet splash vt.handoff=7
    initrd /initrd.img-2.6.38-8-generic
}

This does not cause a boot failure because, it seems, the subsequent search line does find the kernel files. But if that search line is commented out the boot fails.

Steve Langasek (vorlon) on 2011-08-03
affects: grub (Ubuntu) → grub2 (Ubuntu)
Colin Watson (cjwatson) on 2011-08-15
Changed in grub2 (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Colin Watson (cjwatson)
Colin Watson (cjwatson) on 2011-08-15
Changed in grub2 (Ubuntu):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 1.99-12ubuntu1

---------------
grub2 (1.99-12ubuntu1) oneiric; urgency=low

  * Resynchronise with Debian. Remaining changes:
    - Adjust for default Ubuntu boot options ("quiet splash").
    - Default to hiding the menu; holding down Shift at boot will show it.
    - Set a monochromatic theme and an appropriate background for Ubuntu.
    - Apply Ubuntu GRUB Legacy changes to legacy update-grub script.
    - Fix backslash-escaping in merge_debconf_into_conf.
    - Remove "GNU/Linux" from default distributor string.
    - Add crashkernel option.
    - Bypass menu unless other OSes are installed or Shift is pressed.
    - Allow Shift to interrupt 'sleep --interruptible'.
    - Reduce visual clutter in normal mode.
    - Remove verbose messages printed before reading configuration.
    - Suppress kernel/initrd progress messages, except in recovery mode.
    - Show the boot menu if the previous boot failed.
    - Don't generate device.map during grub-install or grub-mkconfig.
    - Adjust upgrade version checks for Ubuntu.
    - Suppress "GRUB loading" message unless Shift is held down.
    - Adjust versions of grub-doc and grub-legacy-doc conflicts.
    - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
    - Look for .mo files in /usr/share/locale-langpack first.
    - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
    - Check hardware support before using gfxpayload=keep.
    - Put second and subsequent Linux menu entries in a submenu.
    - Preferred resolution detection for VBE.
    - Set vt.handoff=7 for smooth handoff to kernel graphical mode.
    - Update default/grub.md5sum to include maverick's default md5sum.
    - Add nomodeset to Linux kernel arguments in recovery mode.
    - Skip Windows os-prober entries on Wubi systems.
  * Suppress the menu by default on Wubi systems with no other-OS entries
    apart from Windows (LP: #826378).
  * Always store hostdisk drive names in canonical form, fixing 'grub-probe
    --target=drive' output when device.map is absent (LP: #820500).

grub2 (1.99-12) unstable; urgency=low

  [ Robert Millan ]
  * Fix grub-probe detection for LSI MegaRAID SAS devices on kFreeBSD.
    - kfreebsd_mfi_devices.patch

  [ Colin Watson ]
  * Backport from upstream:
    - Canonicalise the path argument to grub-probe (closes: #637768).
    - Skip */README* as well as README* (LP: #537123).
 -- Colin Watson <email address hidden> Mon, 05 Sep 2011 16:12:50 +0100

Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released

Thanks for responding to this report so swiftly.

I was just curious as to where the issue resided. Is the grub.cfg stanza syntax erroneous or is it correct and some downstream function at fault?

On Mon, Sep 05, 2011 at 06:50:34PM -0000, <email address hidden> wrote:
> I was just curious as to where the issue resided. Is the grub.cfg stanza
> syntax erroneous or is it correct and some downstream function at fault?

The syntax was wrong. It was produced because Ubuntu prefers to run
without /boot/grub/device.map, which is an upstream goal but not one
that's generally enabled by default as yet. We have a patch to improve
behaviour in that situation, but at some point when merging a new
upstream release I missed a new situation that needed to be handled.

So it's not really possible to say either that it was an upstream bug or
an Ubuntu-specific bug in this case; it was a bit of both.

Either way, it wasn't terribly worrisome because the following 'search'
command generally finds the correct device by UUID, and the 'set root='
line is only a fallback mechanism. Still, it was untidy and confused
people, so I wanted to clean it up anyway.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers