config script thinks grub.d contains all variables

Bug #1199731 reported by Harald Sitter
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Low
Colin Watson

Bug Description

TL;DR: grub maintainer scripts endup writing an empty linux_cmdline if /etc/default/grub.d/* is present from another package.

At least grub-pc's config script thinks that the presence of /etc/default/grub.d/* means that GRUB_CMDLINE_* is defined in there and tries to read it from grub.d/ for usage in a *newly* created config. However in Kubuntu we have one file in grub.d/ and that file only sets GRUB_DISTRIBUTOR.
The config script will - when present - try to read deafult/grub and grub.d/* and then carry the read values into the new deafult/grub. It does however not check whether the read values are null/nil/undefined such that it ends up writing an empty cmdline into default/grub by default.

--- code ----

for x in /etc/default/grub /etc/default/grub.d/*.cfg ; do
  if [ -e "$x" ]; then
    DEFAULT_FOUND="yes"
    . "$x"
  fi
done

if [ "$DEFAULT_FOUND" = "yes" ]; then
  db_set grub2/linux_cmdline "$GRUB_CMDLINE_LINUX"
  db_set grub2/linux_cmdline_default "$GRUB_CMDLINE_LINUX_DEFAULT"

--- code ----

In combination with an issue in ubiquity/d-i which also prevents a default cmdline by default. Put together these issues cause bug 1171099 (no plymouth after installation in kubuntu).

Tags: kubuntu

Related branches

Colin Watson (cjwatson)
Changed in grub2 (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.00-15ubuntu1

---------------
grub2 (2.00-15ubuntu1) saucy; urgency=low

  [ Colin Watson ]
  * Resynchronise with Debian. Remaining changes:
    - Default to hiding the menu; holding down Shift at boot will show it.
    - 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.
    - Suppress "GRUB loading" message unless Shift is held down.
    - Check hardware support before using gfxpayload=keep.
    - Set vt.handoff=7 for smooth handoff to kernel graphical mode.
    - In recovery mode, add nomodeset to the Linux kernel arguments, and
      remove the 'set gfxpayload=keep' command.
    - Skip Windows os-prober entries on Wubi systems, and suppress the menu
      by default if those are the only other-OS entries.
    - Handle probing striped DM-RAID devices.
    - Disable cursor as early as possible in grub_main.
    - Treat Kubuntu as an alias for Ubuntu in GRUB_DISTRIBUTOR.

  [ Harald Sitter ]
  * Update mkconfig_ubuntu_distributor.patch to handle Kubuntu like Ubuntu;
    no GNU/Linux suffix.

grub2 (2.00-15) unstable; urgency=low

  [ Colin Watson ]
  * Install reportbug presubj and script files in all binary packages.
  * Make grub-yeeloong.postinst explicitly install with
    --target=mipsel-loongson (closes: #708204).
  * Make grub-script-check fail on scripts containing no commands (closes:
    #713886).
  * Make the description of grub-firmware-qemu a little more generic, rather
    than assuming that bochsbios provides qemu's default BIOS image (closes:
    #714277).
  * Don't assume that the presence of /etc/default/grub or
    /etc/default/grub.d/*.cfg means that any particular item is set in it
    (LP: #1199731).

  [ Debconf translations ]
  * Hungarian (Dr. Nagy Elemér Károly).
 -- Colin Watson <email address hidden> Sat, 13 Jul 2013 17:08:01 +0100

Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released
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.