Hi,
I don't know if we may have had the same problem, but my motherboard's UEFI refuses to boot anything other than FAT32.
Rather than appending a new .gz file to boot, I've opted for a different approach using "pretce" in my grub.cfg. Specifically, I use the boot code: "pretce=sdc1/pretce" (sdc1 is a 100mb fat32 usb partition (if a second usb is mounted to sdc1 during boot, it will not boot))
I have mdadm and raid-dm (for raid) and filesystems-kernel and mtd-kernel (for btrfs) on sdc1/pretce/optional, also the /sdc1/pretce/onboot.lst.
for btrfs, I employ the command "mount /mnt/sdc2 -o compress=zstd:15" in sdc1/pretce/onpre.sh. This is done to mount the partition that houses the /home and tce directory. (sdc2 is a 58gb btrfs usb partition)
/opt/bootlocal.sh:
..
/opt/md0.sh &
..
/opt/md0.sh:
mda -A --scan
sleep 1 # This pause is crucial as there are times when 'mda -a --scan' completes before the system is fully ready
mount /mnt/md0 -o compress=zstd:15
(md0 is a 2x256gb ssd software raid0 btrfs)
But you could try something like this (after -a scan)
until mdadm --detail /dev/md0 >/dev/null 2>&1; do
sleep 0.1
done
I don't understand a solution to your problem, but I hope that my situation can help you with something.