grub2 parses kernel parameters with $ as shell variables

Bug #448413 reported by shemgp
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Colin Watson

Bug Description

Binary package hint: grub2

The original kernel line in menu.lst was:

kernel /boot/vmlinuz-2.6.31-13-generic root=UUID=2d36e902-cd10-47a1-af4d-3eb85b8d97d6 ro memmap=0x100000$0x38900000 splash

When I install grub-pc it asked me for kernel parameters and a placed memmap=0x100000$0x38900000 as my ram has some bad blocks there. The output of that line in grub.cfg was something like this:

        linux /boot/vmlinuz-2.6.31-13-generic root=UUID=2d36e902-cd10-47a1-af4d-3eb85b8d97d6 ro memmap=0x100000/usr/sbin/update-grubx38900000 splash

which obviously won't let it boot. Edited /etc/default/grub to:


(note the single quote, otherwise it would have been GRUB_CMDLINE_LINUX="memmap=0x100000\\\$0x38900000")
So the output is now:

        linux /boot/vmlinuz-2.6.31-13-generic root=UUID=2d36e902-cd10-47a1-af4d-3eb85b8d97d6 ro memmap=0x100000\$0x38900000 splash

and it boots successfully

I would expect that pasting the text as is would work like before without resorting to backslashes.

I think this bug is related to #445952

ProblemType: Bug
Architecture: i386
Date: Sun Oct 11 09:54:07 2009
DistroRelease: Ubuntu 9.10
Package: grub-pc 1.97~beta3-1ubuntu8
 PATH=(custom, user)
ProcVersionSignature: Ubuntu 2.6.31-13.43-generic
SourcePackage: grub2
Uname: Linux 2.6.31-13-generic i686
 (gnome-settings-daemon:3325): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (gnome-settings-daemon:3325): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (nautilus:3546): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
 (polkit-gnome-authentication-agent-1:3564): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
 (gnome-panel:3435): Gdk-WARNING **: /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkdrawable-x11.c:952 drawable is not a pixmap or window

Revision history for this message
shemgp (shemgp) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks, fixed for my next upload. Bug 445952 is in fact entirely unrelated.

Changed in grub2 (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.8 KiB)

This bug was fixed in the package grub2 - 1.97~beta4-1ubuntu1

grub2 (1.97~beta4-1ubuntu1) karmic; urgency=low

  * Resynchronise with Debian. Remaining changes:
    + debian/default/grub:
      - Adjust for default Ubuntu boot options.
      - Use GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for
        default items only. These options won't be set in single user mode.
      - Default to hiding the menu; holding down Shift at boot will show it.
    + debian/
      - Change default value of grub2/linux_cmdline_default to "quiet
    + debian/, debian/, debian/
      - Migrate timeout settings from menu.lst.
    + debian/grub.d/05_debian_theme:
      - Set a monochromatic theme for Ubuntu.
    + debian/legacy/update-grub:
      - Apply Ubuntu branding: title, recovery mode, quiet option, and tweak
        how memtest86+ is displayed.
      - Use UUIDs where appropriate.
    + debian/control:
      - Conflict with grub (<< 0.97-54) as well as grub-legacy.
    + debian/patches/03_ubuntu_grub_standards:
      - Remove GNU/Linux from default string.
    + debian/patches/10_crashkernel.patch:
      - Add crashkernel= options if kdump and makedumpfile are available.
    + debian/patches/951_quick_boot.diff:
      - If other operating systems are installed, then automatically unhide
        the menu.
      - Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if
        available to check whether Shift is pressed. If it is, show the
        menu, otherwise boot immediately. If keystatus is not available,
        then fall back to a short delay interruptible with Escape.
    + debian/patches/952_sleep_shift.diff:
      - Allow Shift to interrupt 'sleep --interruptible'.
    + debian/patches/954_normal_quiet.diff:
      - Don't display introductory message about line editing unless we're
        actually offering a shell prompt. Don't clear the screen just before
        booting if we never drew the menu in the first place.
    + debian/patches/955_really_quiet.diff:
      - Remove some verbose messages printed before reading the
        configuration file.
    + debian/patches/956_linux_quiet.diff:
      - If the environment variable "quiet" is set to something other than
        0, suppress progress messages as the kernel and initrd load. Set
        this for non-recovery kernel menu entries.
    + debian/patches/957_savedefault.diff, debian/rules:
      - Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot
        utilities. Provides functionality essentially equivalent to GRUB
        Legacy's savedefault.
    + debian/patches/959_loopback_root.diff:
      - Keep the loopback file open so that subsequent changes to the "root"
        environment variable don't affect it.
    + debian/patches/961_handle_loopback.diff:
      - Change prepare_grub_to_access_device to handle filesystems
        loop-mounted on file images.
    + debian/patches/963_linux_no_loopmount.diff:
      - Ignore devices loop-mounted from files in 10_linux.
    + debian/patches/965_failed_boot_menu.diff, debian/grub-common.init,
      - Sh...


Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
mnelson (mjcanelson) wrote :

This still appears to be a problem in 10.04 and grub2 1.98-1

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.