Bug#500336: patch for grub detection

Ian Campbell ijc at hellion.org.uk
Thu Oct 30 10:35:03 UTC 2008


On Thu, 2008-10-30 at 10:57 +0100, Raphael Hertzog wrote:
> On Wed, 29 Oct 2008, Ian Campbell wrote:
> > > > > So the problem would bite people upgrading grub but not the kernel.
> > > > 
> > > > Someone who installs 2.6.26-1-xen-amd64 in a Lenny domU with the Lenny
> > > > version of grub would end up with a menu.lst which did not contain this
> > > > kernel, which would be incorrect.
> > > 
> > > But this is only a problem for pygrub users and it looks like pygrub is
> > > not even packaged for Debian. 
> > 
> > It's just part of Xen:
> > 
> > $ dpkg -S /usr/lib/xen-3.2-1/bin/pygrub 
> > xen-utils-3.2-1: /usr/lib/xen-3.2-1/bin/pygrub
> 
> Hu, okay. I have been using Xen on multiple (etch) machines and never used
> that. I always boot a kernel stored on the dom0.

That's the other alternative and both have their
advantages/disadvantages.

I prefer the pygrub method myself since it keeps all of domU's files
inside the domU itself, I find it particularly useful when dom0 isn't
Debian or when the domU admin doesn't have rights in dom0, for example.

> > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=479478 ?
> > 
> > Yes something like that.
> > 
> > I previously had concerns because /proc/xen doesn't exist on pv ops
> > kernels, but since we would not go down this path on a pv ops kernel
> > this doesn't even make sense to me anymore, I'm not sure what I was
> > thinking... Perhaps I was considering the future existence of pvops
> > domain 0 kernels but since they don't yet exist and probably will
> > have /proc/xen lets not worry.
> 
> I have troubles following your reasoning here. Are you saying that
> the test on /proc/xen/capabilities shown above is enough and should be
> reinstated for the sake of deciding if we're on a domU ?

I remembered my concern.

Keying the behaviour of update grub on the contents
of /proc/xen/capabilities means that the menu.lst which gets generated
will depend on the currently running kernel (since pv ops kernels have
no /proc/xen/cap.. at the moment).

This means that if I am running a pv ops kernel and I install a
non-pvops kernel for whatever reason then my menu.lst will omit it.

Or, even worse, if I have a menu.lst which correctly lists both types of
kernel and I happen to re-run update-grub whilst running a pvops kernel
then a bunch of my working and correct stanzas will be removed.

Or, if I create a domU filesystem using debootstrap or a similar tool
which does the initial construction in a chroot
then /proc/xen/capabilities will look like a dom0 and update-grub will
again do the wrong thing.

Now having a configuration variable "indomu=auto|true|false" allows this
to be worked around but the default would be auto which still has all
the above problems.

I'd be inclined to go with Robert's suggestion of reducing the severity
and not considering the bug RC, the complexity of all these special
cases just aren't worth it, especially since the situation will resolve
itself as pvops becomes the only option.

IMHO there's nothing magic about a Xen kernel which means it should be
treated any different to installing e.g. a PAE kernel on a non-PAE
capable system or otherwise making a mess of your bootloader config or
initrd etc. If you boot one by mistake then simply reboot and choose a
correct kernel.

> > If a user manually installs the non-paravirt -xen-686 kernel in a domU
> > (which is not unlikely, even if I think its unnecessary...):
> 
> Well, I only have the linux-modules-*-xen-686 part in all my domU and not
> the kernel itself.

That's because you don't use pygrub...

> > Since there has historically been no d-i support for Xen (and still
> > isn't for 64 bit) some users will be using constructing a domU using
> > tools such as xen-tools or debootstrap (I'm sure there are others). In
> > that case I'd expect them to get the -xen-686 image since the paravirt
> > ops stuff hasn't propagated to all those tools yet.
> 
> Neither debootstrap nor xen-tools (at least the etch version) do install
> a kernel AFAIK.

OK, in which case the user must install a kernel after running whichever
tool (if they want to use pygrub) and in that case they are reasonably
likely to choose the -xen-686 image due to the name, even though
-686-bigmem would be preferred.

Ian.
-- 
Ian Campbell
Current Noise: Motörhead - Iron Horse

union, n.:
	A dues-paying club workers wield to strike management.






More information about the Pkg-grub-devel mailing list