From c8745addbcba816e8327d17dac610f249c15c372 Mon Sep 17 00:00:00 2001 From: Padreug Date: Thu, 2 Jul 2026 14:49:27 +0200 Subject: [PATCH] fix(deploy): make disk-image-sintra-usb BIOS+UEFI bootable (GRUB) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The USB disk image was systemd-boot (UEFI-only) with make-disk-image's "efi" table (pure GPT + ESP, protective MBR). The Sintra's Aaeon UP Board firmware USB-boots in Legacy/BIOS mode — it boots the live ISO via that ISO's isolinux (BIOS) El Torito image, not the UEFI ESP — so a dd'd systemd-boot image has no BIOS boot code to execute and the firmware won't list it (a hand-added hybrid MBR didn't help: nothing to run). Switch the USB target to GRUB with BIOS + UEFI on make-disk-image's "hybrid" table: it adds a bios_grub partition, GRUB writes its BIOS stage to the MBR AND a removable /EFI/BOOT/BOOTX64.EFI — mirroring the live ISO's dual boot. The Aaeon now lists it (as two "ia android" entries, BIOS + UEFI) and boots it. Scoped to disk-image-sintra-usb only; the eMMC install keeps systemd-boot. ESP stays partition 1 so the ESP-USB relabel step is unchanged. Verified on hardware: booted from USB into the wizard with the full upboard.nix hardware config. Co-Authored-By: Claude Opus 4.8 --- flake.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index a09ffdd..3a678da 100644 --- a/flake.nix +++ b/flake.nix @@ -342,6 +342,25 @@ fileSystems."/".device = lib.mkForce "/dev/disk/by-label/nixos-usb"; fileSystems."/boot".device = lib.mkForce "/dev/disk/by-label/ESP-USB"; system.autoUpgrade.enable = lib.mkForce false; + + # The Sintra's Aaeon firmware USB-boots in Legacy/BIOS mode — it + # boots the live ISO via its isolinux (BIOS) El Torito image, not + # the UEFI ESP. systemd-boot is UEFI-only, so a dd'd systemd-boot + # image isn't recognised as bootable. Switch THIS USB image to + # GRUB with BOTH BIOS (MBR + bios_grub partition, via the "hybrid" + # table below) and UEFI (removable /EFI/BOOT/BOOTX64.EFI) — mirroring + # the live ISO's dual boot — so it boots on Legacy and UEFI alike. + # Scoped to the USB image; the eMMC install keeps systemd-boot. + boot.loader.systemd-boot.enable = lib.mkForce false; + boot.loader.efi.canTouchEfiVariables = lib.mkForce false; + boot.loader.grub = { + enable = lib.mkForce true; + efiSupport = true; + efiInstallAsRemovable = true; + # make-disk-image's build VM exposes the image as /dev/vda; + # GRUB installs its BIOS stage to that disk's MBR. + devices = lib.mkForce [ "/dev/vda" ]; + }; }) ]; }; @@ -349,7 +368,8 @@ inherit pkgs lib; config = cfg.config; format = "raw"; - partitionTableType = "efi"; + # hybrid = GPT + bios_grub partition + ESP → BIOS + UEFI bootable. + partitionTableType = "hybrid"; diskSize = "auto"; label = "nixos-usb"; # ext4 root label (make-disk-image -L) };