Hi Daniel thanks for your reply! You mentioned finding a new LZ4
library but grub2 already looks to support lz4 compressed kernels. The
issue is that they don't look to be supported under the Xen platform
with a target of x86_64.
I'm going to poke around on this today and see what I can figure out. I
was able to get this working by converting the domU to pvh but that has
introduced a few new issues that will require changes to our back-end.
--
Shaun Reitan
NDCHost.com
------ Original Message ------
From: "Daniel Kiper" <dki...@net-space.pl>
To: "Shaun Reitan" <shaun.rei...@ndchost.com>
Cc: "Juergen Gross" <jgr...@suse.com>; grub-devel@gnu.org
Sent: 11/30/2021 9:33:20 AM
Subject: Re: grub2 + xen + lz4 kernels
On Tue, Nov 30, 2021 at 07:21:42AM +0100, Juergen Gross via Grub-devel wrote:
On 30.11.21 00:25, Shaun Reitan wrote:
> I currently use XEN to boot PV (paravirt) virtual server instances for
> our customers. Grub2 introduced support for booting a xen kernel
> directly from a guests disk image which has worked great for years. We
> use the following command to build our image
>
> grub-mkstandalone -O x86_64-xen -o grub2-x86_64.gz boot/grub/grub.cfg
>
> What we have been seeing more and more is newer distros like Ubuntu
> 20.04 using lz4 compressed kernel images which will not boot and
> displays the error "not xen image."
>
> If i use the
https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux
<https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux>
utility
> to decompress the kernel image I am able to boot it without any issues
> using our current grub2 xen loader.
>
> My question is how can I get lz4 support added into grub2 for xen? We
> are willing to pay for a dev to add this support if needed as I have
> limited time to really dig into this.
>
> There are a few workarounds out their, most involve a hook that
> decompresses the kernel after an update but I'm not wanting to add
> complexity to the kernel update process. It leaves too much room for
> error and the possibility of a clients server failing to boot after what
> should of been a simple kernel upgrade.
>
> Any help, even if just pointing me in the right direction would be
> appreciated!
Hmm, Grub2 already supports some compression methods, so adding LZ4
shouldn't be that hard. Especially as there already is some LZ4
support hidden in the ZFS handling.
I guess this LZ4 support wants to be put into a grub module of its
own and then be added to the filter list.
You should have a look at:
- GRUB_FILE_FILTER_GZIO for an example how a compression filter is
added via grub_file_filter_register()
- the file grub-core/fs/zfs/zfs_lz4.c for current LZ4 support in
Grub2
This should basically do the job.
I've added Daniel to Cc: as he might have some more thoughts.
Yeah, in general I agree. However, I would look for an LZ4 library which
could be merged with the GRUB code, licensing compatibility is important
here, and is under active development/maintenance. If there is no such
we can reuse ZFS LZ4 code.
Daniel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel