I upgraded to Ubuntu 20 and fucked up my Xen VM

Surprise surprise, Ubuntu now uses LZ4 compression for Kernels, and this causes issues with Xen pygrub.

I upgraded to Ubuntu 20 and fucked up my Xen VM

So, you did a dist-upgrade of a Ubuntu 18 VM to Ubuntu 20.04 (or probably even to 19) and your Xen VM refuses to start because it can't lz4 decompress the kernel.

xc: error: panic: xc_dom_bzimageloader.c:768: xc_dom_probe_bzimage_kernel unable to LZ4 decompress kernel

"Am I fucked?" I hear you ask yourself? Depends, is this just a test install on a non-productive machine? Then no, definitely not fucked. Is this your production machine and you didn't dry run the upgrade first? Well ... still not fucked but don't ever do that again!

What's the problem actually?

Reading a bit into this you might stumble over this

when Ubuntu switched to L4Z compression in the kernel configuration.

it looks like Xen / pygrub can't handle lz4, I mean, not even Ubuntu 18 has an lz4 package. You can find some discussions about this on the Xen devel list.

How do I unfuck my system?

You need some other machine where you can install lz4 and extract the kernel.

I had a duplicate of the old system still running Ubuntu 18, since the lz4 packages are not available, you can download them from Ubuntu 20 and install them.

wget http://de.archive.ubuntu.com/ubuntu/pool/main/l/lz4/liblz4-1_1.9.2-2_amd64.deb
wget http://de.archive.ubuntu.com/ubuntu/pool/main/l/lz4/lz4_1.9.2-2_amd64.deb
dpkg -i *.deb

apt install elfutils lzop binutils

Once this is done, check out this post: https://unix.stackexchange.com/questions/583714/xen-pvgrub-with-lz4-compressed-kernels/584843#584843

Here is how I did it without the whole automated part:

wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux
chmod 750 extract-vmlinux

TEMP_FILE=$(mktemp /tmp/decompress-kernel-XXXXX)
./extract-vmlinux /root/vmlinuz-5.4.0-66-generic > ${TEMP_FILE}
readelf -h /tmp/decompress-kernel-93rt2 > /dev/null
echo $?

the extract-vmlinux will extract the kernel and save it into TEMP_FILE, check with readelf if everything is ok and it returns 0 as return code.

Take that file, upload it to your server, change menu.lst to use the new extracted file and you can finally boot up your machine again.