Bug#776450: Xen PVH support for grub-xen in Buster

Hans van Kranenburg hans at knorrie.org
Thu Jan 3 00:02:47 GMT 2019


Hi Debian Grub maintainer,

In december, Xen PVH support has been committed in grub master:
https://www.mail-archive.com/grub-devel@gnu.org/msg28125.html

The last pieces needed in the Linux kernel to boot PVH with grub2 landed
in Linux 4.20. I asked our kernel team to carry those patches on top of
the Linux 4.19 kernel that is going to ship in Buster, and that wish was
granted:

https://salsa.debian.org/kernel-team/linux/commit/4d63e6ccbbd6081068633b1147e0f77a59379795

Please see the commit message in there for an explanation why having the
possibility to boot PVH+grub in Debian Buster out of the box would be great.

So here's the question: Do you want to help completing the puzzle and
getting a PVH capable grub2 boot image in the grub-xen-* packages in Buster?

---- >8 ----

I'm currently running self-built boot images, and use the following
recipe to create those:

git clone https://git.savannah.gnu.org/git/grub.git
cd grub
./autogen.sh
rm -rf foo/build
mkdir -p foo/build
cd foo/build
../../configure TARGET_LDFLAGS=-static --target=i386 --with-platform=xen_pvh
make

Now, I create a grub.cfg file and then...

./grub-mkstandalone --grub-mkimage=./grub-mkimage -o
grub-i386-xen_pvh.bin -O i386-xen_pvh -d grub-core/
boot/grub/grub.cfg=grub.cfg

...I end up with something that I can use as kernel image for the Xen
PVH virtual machine.

---- >8 ----

I tried a bit to find out how to change debian/rules in the grub
packaging to make this happen in a similar way as the current support
for PV mode is done, but I have to admit that that's a bit above my
"paygrade". So, I can't attach some patch here yet that already makes it
happen.

However, I'm available to help with testing etc. any time.

---- >8 ----

Slightly OT, but may be interesting for others reading this:

At work, I'm using this in a bit different way than the debian
grub-xen-host/bin package does, since I avoid having anything grub
related in virtual machines.

An example config file is:

root='(xen/xvda)'
insmod xzio
insmod gzio
insmod zstd
insmod btrfs
insmod ext2
echo 'Loading Linux ...'
linux /vmlinuz root=/dev/xvda ro console=hvc0 elevator=noop
echo 'Loading initial ramdisk ...'
initrd /initrd.img
echo 'There we go! ...'
boot

I have a bunch of those with different options etc, and we create the
images and package those up and install them on all the Xen hosts. Since
the disk is always xvda and the right kernel image is always symlinked,
this works for us.

---- >8 ----

Thanks,
Hans van Kranenburg



More information about the Pkg-grub-devel mailing list