ISO El Torito boot image must be a FAT filesystem image, not raw BOOTX64.EFI #34

Open
opened 2026-11-26 01:24:46 +00:00 by muse-lantern · 0 comments
Member

The ISO built by res-os-builder was not detected as a boot device by UEFI firmware — OVMF, VirtualBox, and Hyper-V all refused it. BIOS boot failing is expected (the builder is UEFI-only by design); UEFI failing was the bug.

What was wrong

The El Torito boot image passed to xorriso was the raw BOOTX64.EFI PE binary (xorriso -e EFI/BOOT/BOOTX64.EFI). The UEFI El Torito boot image for platform 0xEF must be a FAT filesystem image: the firmware mounts it and loads \EFI\BOOT\BOOTX64.EFI from inside it. A raw PE is not a filesystem, so no UEFI firmware will accept the disc. Confirmed structurally — the extracted BOOTX64.EFI was a PE32+ executable (335,872 bytes), not a FAT image.

What changed (implemented, commit 0ff2a85 on branch init-setup-gate)

  • New buildEFIBootImage() in internal/iso/iso.go builds a FAT32 image holding the same boot files as the disk ESP: BOOTX64.EFI, limine.conf, vmlinuz, initramfs, microcode. Auto-sized from content plus 96MiB slack, minimum 256MiB.
  • The El Torito boot image is now EFI/BOOT/efiboot.img (xorriso -e EFI/BOOT/efiboot.img), applied to both Build and ConvertRawToISO. ISO-root copies are kept, so ConvertISOToRaw still works.
  • *.iso added to .gitignore (build output was unignored).
  • gofmt clean; go build ./... && go test ./... passes.

One detail: xorriso warns "Boot image load size exceeds 65535 blocks... Will record 0 in El Torito to extend ESP to end-of-medium". A load size of 0 is the standard mechanism for EFI boot images over 32MiB, and OVMF handles it fine.

Verification

  • QEMU/OVMF reproduced the original failure exactly before the fix: BdsDxe: failed to load Boot0001 "UEFI QEMU DVD-ROM QM00001" ... Not Found, then fell through to PXE.
  • After the fix, the rebuilt ISO (609MB, was 254MB — the FAT image duplicates the boot files) boots in QEMU/OVMF: BdsDxe: loading Boot0001, starting Boot0001, RESIDUAL: res-boot alive (Go init), overlay module loaded, no persistence (absent), using tmpfs overlay (ephemeral), overlay mounted (upper=/persist/tmp-upper), switching to overlay root, init=/sbin/init, Starting sshd ... [ ok ], dhcpcd up. Zero BOOT SETUP FAILED, zero emergency-shell drops. Same milestones as the disk-image scenario.
  • Structural check after the fix: El Torito -e '/EFI/BOOT/efiboot.img', -boot-load-size 0; extracted efiboot.img is a valid FAT32 image (label RES_BOOT) containing EFI/BOOT/BOOTX64.EFI, vmlinuz, initramfs (223MB), limine.conf, both ucode images.

What done looks like

The ISO is detected as a UEFI boot device and boots to OpenRC + sshd. QEMU/OVMF proves it; VirtualBox/Hyper-V confirmation on a real rebuild is the remaining check.

Open questions / follow-ups

  • Does the rebuilt ISO boot in VirtualBox and Hyper-V UEFI mode? (Zach to confirm on his Windows box.)
  • boot.sh (the fallback when res-boot is absent) has never been live-boot-tested; only the res-boot path is exercised by QEMU.
  • The ESP is labeled RES_BOOT, not RESIDUAL_BOOT, so residual.conf is never read and defaults apply (pre-existing; the builder labels the ESP RES_BOOT).
  • Guest network under QEMU: sshd starts but the forwarded port yields no banner (pre-existing, not a gate failure).
The ISO built by res-os-builder was not detected as a boot device by UEFI firmware — OVMF, VirtualBox, and Hyper-V all refused it. BIOS boot failing is expected (the builder is UEFI-only by design); UEFI failing was the bug. What was wrong The El Torito boot image passed to xorriso was the raw BOOTX64.EFI PE binary (xorriso -e EFI/BOOT/BOOTX64.EFI). The UEFI El Torito boot image for platform 0xEF must be a FAT filesystem image: the firmware mounts it and loads \EFI\BOOT\BOOTX64.EFI from inside it. A raw PE is not a filesystem, so no UEFI firmware will accept the disc. Confirmed structurally — the extracted BOOTX64.EFI was a PE32+ executable (335,872 bytes), not a FAT image. What changed (implemented, commit 0ff2a85 on branch init-setup-gate) - New buildEFIBootImage() in internal/iso/iso.go builds a FAT32 image holding the same boot files as the disk ESP: BOOTX64.EFI, limine.conf, vmlinuz, initramfs, microcode. Auto-sized from content plus 96MiB slack, minimum 256MiB. - The El Torito boot image is now EFI/BOOT/efiboot.img (xorriso -e EFI/BOOT/efiboot.img), applied to both Build and ConvertRawToISO. ISO-root copies are kept, so ConvertISOToRaw still works. - *.iso added to .gitignore (build output was unignored). - gofmt clean; go build ./... && go test ./... passes. One detail: xorriso warns "Boot image load size exceeds 65535 blocks... Will record 0 in El Torito to extend ESP to end-of-medium". A load size of 0 is the standard mechanism for EFI boot images over 32MiB, and OVMF handles it fine. Verification - QEMU/OVMF reproduced the original failure exactly before the fix: BdsDxe: failed to load Boot0001 "UEFI QEMU DVD-ROM QM00001" ... Not Found, then fell through to PXE. - After the fix, the rebuilt ISO (609MB, was 254MB — the FAT image duplicates the boot files) boots in QEMU/OVMF: BdsDxe: loading Boot0001, starting Boot0001, RESIDUAL: res-boot alive (Go init), overlay module loaded, no persistence (absent), using tmpfs overlay (ephemeral), overlay mounted (upper=/persist/tmp-upper), switching to overlay root, init=/sbin/init, Starting sshd ... [ ok ], dhcpcd up. Zero BOOT SETUP FAILED, zero emergency-shell drops. Same milestones as the disk-image scenario. - Structural check after the fix: El Torito -e '/EFI/BOOT/efiboot.img', -boot-load-size 0; extracted efiboot.img is a valid FAT32 image (label RES_BOOT) containing EFI/BOOT/BOOTX64.EFI, vmlinuz, initramfs (223MB), limine.conf, both ucode images. What done looks like The ISO is detected as a UEFI boot device and boots to OpenRC + sshd. QEMU/OVMF proves it; VirtualBox/Hyper-V confirmation on a real rebuild is the remaining check. Open questions / follow-ups - Does the rebuilt ISO boot in VirtualBox and Hyper-V UEFI mode? (Zach to confirm on his Windows box.) - boot.sh (the fallback when res-boot is absent) has never been live-boot-tested; only the res-boot path is exercised by QEMU. - The ESP is labeled RES_BOOT, not RESIDUAL_BOOT, so residual.conf is never read and defaults apply (pre-existing; the builder labels the ESP RES_BOOT). - Guest network under QEMU: sshd starts but the forwarded port yields no banner (pre-existing, not a gate failure).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
residual/.agent#34
No description provided.