[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Grub xen_pvh platform does not seem to support uncompressed kernels



Hi,

[ xen-users in CC as I know a few there are using a decompressed
  kernel workaround for LZ4 and might be hit by this too ]

I'm currently evaluating switching from booting Xen guests with grub
Xen PV (grub-mkimage -O x86_64-xen) to Xen PVH (grub-mkimage -O
i386-xen_pvh). I've noticed that a decompressed guest kernel refuses
to boot under PVH with the following error:

Loading Linux 5.4.0-52-generic ...
error: invalid magic number.

That same kernel boots with PV.

If I use the LZ4-compressed version of that kernel as supplied by
the distribution (Ubuntu 20.04), it works PVH. I therefore can only
conclude that PVH grub doesn't like kernels with no compression. Is
that expected?

I suppose it is possible that the method I use to decompress the
kernel could be wrong, though as I say, it does work with PV grub. I
basically use the extract-vmlinux script from the upstream kernel
source¹.

When decompressed:

$ sudo file /boot/vmlinuz-5.4.0-52-generic
/boot/vmlinuz-5.4.0-52-generic: ELF 64-bit LSB executable, x86-64, version 1 
(SYSV), statically linked, 
BuildID[sha1]=d435b2b7b13b7e1904dddeee22bff30225d2bd04, stripped
$ ls -lah /boot/vmlinuz-5.4.0-52-generic
-rw------- 1 root root 43M Nov  1 20:00 /boot/vmlinuz-5.4.0-52-generic

When leaving it LZ4 compressed as it comes from the distributor:

$ sudo file /boot/vmlinuz-5.4.0-52-generic
/boot/vmlinuz-5.4.0-52-generic: Linux kernel x86 boot executable bzImage, 
version 5.4.0-52-generic (buildd@lgw01-amd64-060) #57-Ubuntu SMP Thu Oct 15 
10:57:00 UTC 2020, RO-rootFS, swap_dev 0xB, Normal VGA
$ ls -lah /boot/vmlinuz-5.4.0-52-generic
-rw------- 1 root root 12M Oct 15 11:33 /boot/vmlinuz-5.4.0-52-generic

The reason why I am decompressing these guest kernels is because
PV grub does not understand LZ4 compression and as I currently do
boot guests this way, they would be unbootable otherwise.

For new installs I can skip installing my hack that decompresses the
kernel image, but if PVH grub won't support uncompressed kernel
images then this is inconvenient for the installed base who will
need to make extra changes.

Is not supporting decompressed kernel images a bug in PVH grub?

This was tested with a git clone just now, following these
instructions:

    
https://wiki.xenproject.org/wiki/Xen_4.12_RC_test_instructions#PVH_domU_boot_via_grub2

Thanks,
Andy

¹ 
https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.