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

Reply via email to