Update: I got it working, with small issues left that probably can be fixed:
- build pipxe for RPi4 (see my description from https://github.com/ipxe/pipxe/issues/2#issuecomment-808703259)
- tell your TFTP server to provide the UEFI firmware on legacy boot, and the IPXE binary on UEFI boot. Others have documented how this works
- get
hw-20.04-edge
images and put them on a webserver (tftp works too but is slower) - ungzip kernel (my ipxe doesn’t otherwise see it as an EFI binary)
- use this ipxe script:
#!ipxe
dhcp
initrd http://my.server.ip/focal-maas/arm64/boot-initrd
chain http://my.server.ip/focal-maas/arm64/boot-kernel initrd=boot-initrd root=squash:http://my.server.ip/focal-maas/arm64/squashfs ip=dhcp overlayroot=tmpfs:recurse=0 ds=nocloud-net;s=https://cloud-init-server/cloud-init/
The machine first boots into UEFI using RPi’s firmware bootloader, you select to use UEFI PXE IPv4, then it loads ipxe, which then loads the images and boots into linux. From here on it behaves the same way as on x86.
What is left is to configure the UEFI firmware to use full RAM (now limited to 3GB) and to change the boot order to use PXE IPv4 first.