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

Bug #291256 reported by Cody A.W. Somerville
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CE Image Build Infrastructure
Fix Released
High
Unassigned
Debian
New
Unknown
grub (Ubuntu)
Fix Released
Undecided
Basavaraj

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.

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

sortedKernels=""
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
  is_xen=1
 else
  is_xen=
 fi

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

Tags: oem-services
Changed in bugsy:
importance: Undecided → High
status: New → Confirmed
Changed in grub:
status: New → Confirmed
Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

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

Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

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

Revision history for this message
Steve Magoun (smagoun) wrote :

I think the patch in this Debian bug does the right thing:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=479478

Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

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
Revision history for this message
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)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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