Stop bundling the Linaro UEFI firmware for ARM64 - #12
Merged
Merged
Conversation
The Linaro release server that `linaro_uefi.fd` was downloaded from has been retired. It now redirects to a landing page that answers with HTTP 200 and an HTML body, so 1.1.0 shipped a 49 KB HTML page where a 2 MiB firmware belonged and broke every OpenBSD ARM64 job. Rather than replace the download, drop the firmware. OpenBSD ARM64 was its only consumer and it now boots on the shared edk2 `uefi.fd` with the machine type set to `virt,acpi=off`, so there is nothing left to bundle. `download_file` now refuses to write anything but the requested payload: it raises on a non-success HTTP status and on an HTML body, detected both by `Content-Type` and by sniffing the leading bytes. The riscv64 U-Boot download still uses it. `test.rb` gained a `FirmwareValidator` that reads every bundled firmware out of the tarball and rejects HTML documents and implausibly small files, so a corrupt bundle fails the build instead of shipping. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jacob-carlborg
force-pushed
the
fix-linaro-uefi-download
branch
from
July 30, 2026 15:53
296571d to
bc26fff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Qemu::Arm64#bundle_uefidownloadedlinaro_uefi.fdfromhttps://releases.linaro.org/components/kernel/uefi-linaro/latest/release/qemu64/QEMU_EFI.fd.That host has been retired: the URL now 302-redirects to
https://www.linaro.org/contact/, which answers with HTTP 200 and an HTMLbody.
download_fileusedURI.openand wrote whatever it received withoutvalidation, so the 1.1.0 build silently bundled a 49381-byte HTML page
("Contact | Linaro") as
share/qemu/linaro_uefi.fd(the correct file in 1.0.0is 2097152 bytes).
Arm64OpenBsdincross-platform-actions/actionis the only consumer of thatfirmware, so every OpenBSD ARM64 job fails.
test.rbdid not catch it because the firmware assertions only checked thatthe files were present in the tarball.
Changes
Boot OpenBSD on ARM64 with the shared EDK II UEFI firmware action#160 boots it on the shared edk2
uefi.fdbysetting the machine type to
virt,acpi=off. edk2 publishes ACPI tables andOpenBSD 7.x/arm64 hangs during ACPI attach; suppressing them makes the kernel
fall back to the device tree, which is exactly what the old Linaro build
offered. With no consumer left there is nothing to download and nothing to
vendor, so
bundle_linaro_uefi,linaro_uefi_target_pathand thelinaro_uefi.fdentry in the arm64 firmware list are gone.download_filefails loudly. It raises on a non-success HTTP status andon an HTML body (by
Content-Typeor by sniffing the leading bytes), andwrites the destination only after validation, in binary mode. The check is
generic, so the riscv64 U-Boot
.debdownload is protected too.test.rbchecks firmware contents. A newFirmwareValidatorreads everyshare/qemu/*entry out of the bundle and asserts it is at least 4 KiB andnot an HTML document. Applied to x86_64, arm64 and riscv64.
This is a behavioural change for consumers of the tarball, so the changelog
records it under Removed:
qemu-system-aarch64-*.tarno longer containsshare/qemu/linaro_uefi.fd.Depends on cross-platform-actions/action#160 — that PR must ship for OpenBSD
ARM64 to keep booting once a release cut from this branch is consumed.
Verification
The full suite needs built QEMU artifacts, so it cannot run locally.
ruby -c ci.rbandruby -c test.rbboth reportSyntax OK.The bundle assertions were run against three synthetic
qemu-system-aarch64-macos.tarfixtures:efi-e1000.rom,efi-virtio.rom,uefi.fdlinaro_uefi.fd+share/qemu/linaro_uefi.fd'linaro_uefi.fd' is an HTML document, not firmwareuefi.fdtruncated to 512 bytes'uefi.fd' is 512 bytes, expected at least 4096The second row confirms both that the arm64 expectations no longer list
linaro_uefi.fdand that an unexpected extra firmware in the bundle is now afailure.
The hardened
download_filewas exercised against a local HTTP server:application/octet-stream, 64 KiB binarytext/htmlapplication/octet-stream, HTML bodytext/htmlpageOpenURI::HTTPError, no file🤖 Generated with Claude Code