It seems that I just can't stop finding weird btrfs setups that break
the current script.
When you use btrfs with a default subvolume, GRUB will use normal paths,
like on ext4. So instead of /@/boot/vmlinuz you have /boot/vmlinuz.
The issue is that grub2-mkrelpath doesn't know about that. The script
would have to parse the GRUB configuration and fstab, to figure out
if btrfs is used with a default subvolume, and then add a flag to the
command depending on that.
However, instead of adding yet another workaround, let's just forget
about grubby and do what we want to do ourselves. Because, as it turns
out, not taking a weird detour over the path that GRUB uses to load the
kernel makes everything much easier.
Since this means that we are dealing with even more filepath and string
mangling, I decided to rewrite the script in python. It would work fine
in bash, but it would be even more spaghetti code that I don't really
want to write. And python is always available in Fedora anyway,
because DNF is written in it.
On Fedora the kernel needs to be loaded into RWX memory by GRUB.
If it is loaded from non-writable memory, it will crash and freeze
the machine at the Microsoft logo.
Unsetting this flag will cause GRUB to allocate RWX memory for the
kernel.
Note: This won't fix the stock kernels or the installation image.
Ubuntu mainline repos are currently stuck at v6.5.7. However, our
patches are for v6.5.8+ and have thus dropped the serial suspend fix,
which was added upstream in v6.5.8. So add it to the Debian/Ubuntu
package specific patches for now so that we can still build
Debian/Ubuntu kernel packages.