Bug#343076: Xen support in update-grub

Tore Anderson tore at debian.org
Mon Dec 12 13:18:44 UTC 2005


Package: grub
Severity: wishlist

  Hi.  I've noticed that when running update-grub, all bootable images
 get a "Debian GNU/Linux, kernel ..."-entry, even though they are Xen
 images.  It would be really cool if update-grub would notice these, and
 create proper entries for them automagically.  A proper Xen entry looks
 like this:

    title Xen 3.0.0 / XenLinux 2.6.12.6
      kernel /boot/xen-3.0.0.gz dom0_mem=262144
      module /boot/vmlinuz-2.6.12.6-xen0 root=/dev/hda5 ro console=tty0 quiet
      module /boot/initrd.img-2.6.12.6-xen0

  In case you aren't familiar with Xen, I'll explain a bit:

  The "kernel" above is the Xen hypervisor, which is responsible for
 delegating resources to the various "domains" (operating system
 kernels, can be Linux, Solaris, *BSD, even Windows).  The first
 "module" line is the actual Linux kernel which is booted into domain 0,
 a special privileged domain where the hardware device drivers usually
 run.  Here it is allocated 256MB of RAM by the Xen hypervisor (perhaps
 there should be a "xenopt" setting akin to "kopt" for supplying boot
 arguments to the Xen hypervisor).

  There may also exist other kernels used for unprivileged domains,
 but Grub should ignore these, as they are started from domain 0, not
 from the bootloader.  The second "module" is to specify an initrd for
 the domain 0 kernel, if needed.

  A Linux kernel meant for running in Xen is easily identified by
 looking in its corresponding config file:

    CONFIG_XEN_PRIVILEGED_GUEST=y

  If that setting is enabled, it's meant for domain 0, if not, it's for
 an unprivileged domain (and should be ignored by update-grub).  If it
 isn't there at all it's probably a normal Linux kernel image.  :-)

  I'm not entirely sure how to best identify a Xen hypervisor image; 
 "file" doesn't know what it is, but it's obvious when you're looking
 at it with "strings"...  Perhaps just keying off the name is the
 easiest (it's generally called "xen-$VERSION.gz).  I'm haven't looked
 into how kernels are detected right now so I don't know what would be
 the most proper way to implement it.

  The resulting list of menu entries should probably be a cartesian
 product of all available Xen hypervisors and all available domain 0
 kernels.

  I would be happy to give you examples of Xen hypervisor or kernel
 images if you're interested.  Or you may download them from
 <http://www.xensource.com/products/downloads/>.  (Tip:  Use the
 bittorrent link if you don't like giving out your email address).

Kind regards
-- 
Tore Anderson





More information about the Pkg-grub-devel mailing list