I’ve had a pretty good experience with UEFI booting my Pi4 (ZFS root on USB SSD, initially grub now systemd-boot), so I decided to try it on my Pi3 as well, which is BTRFS root also on a USB SSD.
Apparently the Pi3 bootloader requires MBR instead of GPT, and systemd-boot refuses to work with MBR.
I thought it would be no big deal – just use grub, but grub doesn’t seem to be producing any code in the EFI partition (I’m expecting something like efi/boot/bootaa64.efi).
When I run nixos-install, I get no errors, everything looks fine, just doesn’t boot. When I look closer, the boot*.efi file is missing.
When I nixos-enter into the image and manually NIXOS_INSTALL_BOOTLOADER=1 switch-to-configuration, I get the error below:
# NIXOS_INSTALL_BOOTLOADER=1 /run/current-system/bin/switch-to-configuration switch
updating GRUB 2 menu...
ERROR: Could not search B-tree: Function not implemented
Failed to retrieve subvolume info for /boot
Failed to install bootloader
BTRFS scrub comes up clean, the devices seems to mount and read normally.
Yes – @boot is a top-level subvolume mounted to /boot, with a FAT partition at /boot/efi. I’ve used this setup on my Pi4 (and other BTRFS-root UEFI machines) without issue.
Stuff like this is exactly why I tell people to just use systemd-boot and to mount the ESP at /boot. It’s so much simpler and you don’t have to deal with grub screwing things up half the time.
I mentioned above – systemd-boot refuses to install due to being MBR, so includes some additional levels of complexity (figuring out GPT with Hybrid MBR). Unless you’re aware of a way to get systemd-boot to work with the standard RPi3 MBR setup?