Fixing update-grub to work with paravirt ops (2.6.22+) Xen kernels

Ian Campbell ijc at hellion.org.uk
Wed May 7 14:54:53 UTC 2008


On Wed, 2008-05-07 at 15:53 +0200, Robert Millan wrote:
> On Tue, May 06, 2008 at 09:59:48PM +0100, Ian Campbell wrote:
> > 
> > Any thoughts from the grub maintainers on this patch? (reattached as
> > update-grub-better-xen-support.patch).
> > 
> > This behaviour (along with #456776) is one of the major roadblocks
> > stopping d-i from working seamlessly in a Xen guest environment. It
> > would be really awesome to have this work for Lenny!
> 
> Hi Ian,

Hi Robert,

> Can we get this sorted out on GRUB 2 first?  If we check it in only for GRUB
> Legacy, it means it's one more regression we'll need to take care of.
> 
> I noticed you already sent the GRUB 2 patch to grub-devel.  I've just sent a
> reply there.  Can you check?  Once it's merged into GRUB 2, we could consider
> backporting this functionality if needed.

Just to clarify that there are two sets of patches/issues at hand here:

The patch I sent to grub-devel is about having grub/grub2 understand the
xvd device types. That is #456776 against grub and #456777 against
grub-2. I'll respond to the comments on grub-devel when I get home
tonight and have a moment to check my facts etc. I'm completely happy to
work on getting this included in grub-2 first as you request.

The second issue is the behaviour of update-grub in grub legacy wrt to
kernels with CONFIG_XEN(_PRIV..._GUEST) vs CONFIG_PARAVIRT
+CONFIG_XEN. The issue is that grub legacy's update-grub does not
handle the CONFIG_PARAVIRT+CONFIG_XEN case. As far as I can tell grub-2
currently has no special handling of Xen enabled kernels
(i.e. /etc/grub.d/10_linux doesn't have any Xen specific checks) and so
there is no problem with grub-2[0].

My preferred patch for this issue is
update-grub-no-xen-special-case.patch which makes the grub and grub-2
behaviour WRT Xen enabled kernels the same by removing the Xen special
cases from grub-legacy. I think this is the correct thing to do since
the special casing in grub legacy, while a nice idea, is mostly just
confusing and gets in the way of the admin (e.g. it doesn't work if you
create your guest filesystem in a chroot or if you wish to switch
between HVM and PV mode, e.g. #479478). In this case there is no
equivalent patch required for grub-2 and so no regression is created by
patching grub-legacy.

If you prefer the special casing I could look at creating a patch for
grub-2 which implements the same scheme as
update-grub-better-xen-support.patch does for grub-legacy.

Cheers,
Ian.

[0] As a separate issue grub-2 doesn't yet know about creating stanzas
for domain0 use, i.e. hypervisor+dom0 kernel but that is unrelated to
the above. I was planning to have a tinker with
making /etc/grub.d/nn_xen at some point, not sure if that is a patch for
you or the xen maintainers though.

-- 
Ian Campbell

  We must believe in free will. We have no choice. -Isaac B. Singer




More information about the Pkg-grub-devel mailing list