update-grub ignores non-xen kernels if the system is a domU

Bug #291256 reported by Cody A.W. Somerville on 2008-10-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CE Image Build Infrastructure
grub (Ubuntu)

Bug Description

Binary package hint: grub

update-grub ignores non-xen kernels if the system is a domU and provides no mechanism to override/force otherwise. This behaviour was introduced in 0.97-22 in response to Debian bug #404536 (update-grub should put xen kernels in menu.lst when run in a domU). Unfortunately, this is not desirable if you're building images for non-xen systems on a xen instance as menu.lst will not contain any kernels and the image will not boot.

if [ -e /proc/xen/capabilities ] && ! grep -q "control_d" /proc/xen/capabilities; then

for kern in $(/bin/ls -1vr /boot | grep -v "dpkg-*" | grep "^vmlinuz-") ; do
 if `echo "$xenKernels" | grep -q "$kern "` || `echo "$kern" | grep -q "xen"`; then

 if [ ! "$in_domU" ] && [ "$is_xen" ]; then
   # skip xen kernels
        elif [ "$in_domU" ] && ! [ "$is_xen" ]; then
   # skip non-xen kernels

Changed in bugsy:
importance: Undecided → High
status: New → Confirmed
Changed in grub:
status: New → Confirmed

I've attached a patch with the solution we've deployed internally at OEM Services Group.

Another idea might be to prompt the user and then have the -y flag assume to include the kernels.

Steve Magoun (smagoun) wrote :

I think the patch in this Debian bug does the right thing:

After speaking with Steve Langasek, I've attached a branch ( ~cody-somerville/grub/grub-fixlp291256) with a fix we feel would be best.

Changed in bugsy:
status: Confirmed → Fix Released
Changed in grub:
status: Confirmed → Triaged
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub - 0.97-29ubuntu46

grub (0.97-29ubuntu46) jaunty; urgency=low

  * debian/update-grub:
    - Added menu.lst option "indomU" to be able to manually specify if
      update-grub should produce a menu.lst appropriate for a domU (true), a
      non-virtualized environment (false), or the current environment as
      detected (detect).
    - Based off patch submitted to DBTS by Evan Broder, thanks Evan. (479478)
    - Closes LP: #291256

 -- <email address hidden> (Cody A.W. Somerville) Thu, 06 Nov 2008 14:36:13 -0500

Changed in grub:
status: Triaged → Fix Released
Michael Terry (mterry) on 2009-10-28
tags: added: oem-services
Changed in grub (Ubuntu):
assignee: nobody → Basavaraj (basavarajmulagund92)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.