And I installed edk2-rk3588 UEFI Firmware to make booting from NVMe possible. But the issue is that the standard NixOS SD card image only uses extlinux, and does not support UEFI.
I looked at available definitions for SD card images and it seems all of the aarch64 use extlinux:
I tried some experiments using raw-efi format with nixos-generators but I couldn’t get them to boot.
The reason I want a NixOS image is that all of the non-NixOS ones like Armbian or stock inage from Rdaxa have ancient 5.10 kernels which prevent me from using ZFS to do the installation on the NVMe. It’s quite the rabbit hole.
So my question is, how would one go about creating an aarch64 SD card image supporting UEFI boot?
If the devices actually support UEFI, then you can use the aarch64 ISO image instead of the SD image, and you can install to storage like normal. This would really be ideal; it would be exactly like how we install NixOS on x86_64 devices. You boot the ISO, create and mount the file systems, nixos-generate-config, make sure it’s using a UEFI boot loader, nixos-install, and you’re good.
All this is dependent on the devices actually having proper UEFI support, of course. But it sounds like you’re manually setting up EDK2 on them, so that’s promising.
But when I attempt to boot into it it just takes me back to the “Boot Manager” view. No errors.
If I just let it boot without intervention I just get a lot of errors like this:
Trying to boot from MMC2
No misc partition
spl: partition error
Trying fit image at 0x4000 sector
Not fit magic
Trying fit image at 0x5000 sector
Not fit magic
sys malloc pool space exhausted
alloc_read_gpt_entries: ERROR: Can't allocate lX bytes for GPT Entries
GPT: Failed to allocate memory for PTE
part_get_info_efi: *** ERROR: Invalid GPT ***
part_get_info_efi: *** Using Backup GPT ***
What’s interesting is that I can boot NixOS from the NVMe just fine, which I unstalled form an Armbian image. But I have yet to find a single NixOS image that can boot. I don’t get it.
Did you install to your board with this ISO image? I can see the grub menu, however, the installer just hangs on exiting boot service, I can’t figure out why.
I’ve tried all the images you mentioned in that github issue with SD card and usb, unfortunately, they all just hangs on EFI stub: Exiting boot services. My SBC is orange pi 5, if that’s related.