From: Andy Smith <andy@strugglers.net>
To: grub-devel@gnu.org
Cc: xen-users <xen-users@lists.xenproject.org>
Subject: Grub xen_pvh platform does not seem to support uncompressed kernels
Date: Mon, 2 Nov 2020 06:22:58 +0000 [thread overview]
Message-ID: <20201102062258.GN16003@bitfolk.com> (raw)
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
next reply other threads:[~2020-11-02 6:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 6:22 Andy Smith [this message]
2020-11-02 7:43 ` Grub xen_pvh platform does not seem to support uncompressed kernels Jürgen Groß
2020-11-02 8:27 ` Andy Smith
2020-11-02 8:43 ` Jürgen Groß
2020-11-02 9:17 ` Andy Smith
2020-11-02 9:39 ` Jürgen Groß
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201102062258.GN16003@bitfolk.com \
--to=andy@strugglers.net \
--cc=grub-devel@gnu.org \
--cc=xen-users@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.