Bug#505517: [Pkg-xen-devel] #505517 [grub-pc] Dosen't handle xen dom0 kernel automagically [PATCH]

Ian Campbell ijc at hellion.org.uk
Mon Nov 17 17:30:33 UTC 2008


On Mon, 2008-11-17 at 18:02 +0100, Didier Raboud wrote:
> Here is a patch that solves bug #505517 in two steps :
>
> * grub-pc_00_add_xen_support.patch
> 	Removes the xen kernels from 10_linux's listing
> 	(simply blacklisting *-xen-* kernels and initrds)

This is wrong for a few reasons.

First the uname of the kernel is not a strong indicator of its Xen'ness.
Consider that XEN could just as likely be the users initials or the name
of a particular machine for which this is a custom kernel.

Secondly modern kernels (with CONFIG_PARAVIRT=y) can be booted on both
Xen and native so you want a native entry to support that.

Thirdly pygrub can be used to boot a domU by examining the inguest grub
configuration. This relies on the presence of a native style entry
inside the guest (although it doesn't currently speak the grub2 config
file format).

The only case where you might historically have wanted to exclude a
kernel is a legacy (not CONFIG_PARAVIRT) kernel when you are running in
domain 0 but that is counter to the pygrub usecase and it is complicated
to detect when you are in domain 0 vs domain U reliably. Since it only
effects legacy kernels it is best to just ignore it since it will go
away shortly, IOW never filter away any Xen kernels.

There are a number of closed bugs against grub1's update-grub about this
issue, I guess debian/changelog of the grub1 source would list them.

> 
> * grub-pc_01_add_xen_support.patch
> * grub-pc_02_add_xen_support.patch
> * grub-pc_03_add_xen_support.patch
> 	Add a 10_xen in /etc/grub.d/ for support of the Xen hypervisors
> 	Lists all the *-xen-* kernels for each hypervisor version

Only kernels which have CONFIG_XEN_PRIVILEGED_GUEST=y should get a
hypervisor style stanza (in addition to a native one as discussed
above).

Looks like there is some code duplication in 10_linux vs 10_xen, is
there some common location you could put it ?

Usually with grub1 Xen was listed first (I guess since in all likelihood
if you installed it you will boot it) so perhaps 09_xen ???

Ian.
-- 
Ian Campbell
Current Noise: Pride And Glory - Losin' Your Mind

It is clear that the individual who persecutes a man, his brother, because
he is not of the same opinion, is a monster.
		-- Voltaire






More information about the Pkg-grub-devel mailing list