From 8d5fad76fd2abf68daaeb854df2f1e94d0ebca39 Mon Sep 17 00:00:00 2001 From: oqyude Date: Tue, 13 Oct 2026 03:53:14 +0300 Subject: [PATCH] fix(pxe-infra): back to sanboot now that ESP has BOOTX64.EFI The previous run of imgfetch+boot crashed at RIP 0x7EE855FC in iPXE. iPXE was passing the full 2GB raw disk image to the firmware 'boot' primitive, which expects a UEFI PE executable (a small file with a PE header), not a 2GB block-device image. The firmware's PE loader hits uninitialised memory and the RIP-AF pattern reappears. The earlier sanboot attempt also crashed, but that was before the systemd-boot fix gave the image a real \EFI\BOOT\BOOTX64.EFI. sanboot presents the URL as a block device, the firmware walks the GPT and finds the ESP, systemd-boot runs, and the kernel boots from the local ext4 partition. This is the right primitive for raw disk images served over HTTP. Refs: docs/ARCHITECTURE.md section L4. --- modules/pxe-infra/ipxe.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/pxe-infra/ipxe.nix b/modules/pxe-infra/ipxe.nix index 7cf7cfb..154c5f8 100644 --- a/modules/pxe-infra/ipxe.nix +++ b/modules/pxe-infra/ipxe.nix @@ -39,13 +39,17 @@ environment.etc."pxe-infra/http/boot.ipxe".source = pkgs.writeText "boot.ipxe" '' #!ipxe set boot-url http://${config.pxe-infra.bridge.address}/latest - imgfetch ''${boot-url}/alpine-worker.raw - boot || goto retry + # sanboot (not imgfetch+boot) is the right primitive for + # raw disk images: it presents the URL as a block device + # to the firmware, and the firmware walks the partition + # table to find a bootloader. `boot` tries to parse the + # blob as a UEFI PE executable, which a 2 GB raw disk + # is not. + sanboot ''${boot-url}/alpine-worker.raw || goto retry :retry - echo boot failed, retrying in 5s + echo sanboot failed, retrying in 5s sleep 5 - imgfetch ''${boot-url}/alpine-worker.raw - boot + sanboot ''${boot-url}/alpine-worker.raw ''; }; }