Skip to content

new(tianocore.org/edk2): standalone OVMF firmware blobs#13239

Open
tannevaled wants to merge 3 commits into
pkgxdev:mainfrom
tannevaled:new/tianocore.org/edk2
Open

new(tianocore.org/edk2): standalone OVMF firmware blobs#13239
tannevaled wants to merge 3 commits into
pkgxdev:mainfrom
tannevaled:new/tianocore.org/edk2

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Summary

  • New recipe projects/tianocore.org/edk2/package.yml ships TianoCore EDK II OVMF firmware blobs (X64 + AARCH64) at ${prefix}/share/qemu/edk2-*-code.fd / edk2-*-vars.fd, matching qemu's bundle layout so existing runners can pick it up via env-var overrides.
  • Cross-platform via EDK II's GCC5 toolchain on Linux and CLANGPDB on Darwin (uses pantry's llvm.org for clang + lld-link, avoiding the macOS-only mtoc).
  • Versioned via edk2-stableYYYYMM[.N] tags with match: /^edk2-stable\d+(\.\d+)?$/ + matching strip.

Motivation

Today the only convenient way to get OVMF on a pkgx machine is to fish it out of qemu.org's bottle (or grep a distro's ovmf package). That couples firmware updates to qemu's release cadence and ships nothing on systems that only need the firmware (e.g. cloud-boot harnesses). This recipe makes EDK II a first-class package: bump the recipe version and you get a fresh stable EDK II without waiting on qemu.

Recipe shape

  • distributable: git+https://github.com/tianocore/edk2 with ref: edk2-stable{{version.raw}}.
  • Build deps: git-scm.org, python.org ~3.11, nasm.us, freedesktop.org/pkg-config; platform-conditional gnu.org/gcc (linux) and llvm.org (darwin).
  • Build script: submodule init, BaseTools make, edksetup.sh BaseTools, two build invocations (X64 OvmfPkg + AARCH64 ArmVirtQemu), install into share/qemu/.
  • Includes a small -Wno-error=cast-function-type-mismatch patch (CryptoPkg/Pem) for newer clang.
  • runtime.env exports EDK2_FIRMWARE_DIR, OVMF_CODE, OVMF_VARS, AAVMF_CODE, AAVMF_VARS.
  • provides: bin/edk2-firmware-path is a thin shim that prints absolute blob paths for downstream tooling.

Follow-ups (not in this PR)

  • RISCV64 and LOONGARCH64 targets — DSCs exist but cross-toolchain wiring needs more shake-out.
  • Optional acpica-tools (iasl) dep when pantry ships one; current build paths use precompiled ACPI tables, so it's not required for OVMF/ArmVirt.

Test plan

  • CI: bk build tianocore.org/edk2 on linux/x86_64 — primary path, no toolchain quirks expected.
  • CI: bk build tianocore.org/edk2 on linux/aarch64.
  • CI: bk build tianocore.org/edk2 on darwin/arm64 — CLANGPDB path.
  • bk test tianocore.org/edk2 boots qemu-system-x86_64 with the built firmware and greps the TianoCore banner.

tannevaled and others added 3 commits June 6, 2026 08:44
Defense-in-depth follow-up to pkgxdev/brewkit#353.

Some recipes ship binaries with entitlements that require either adhoc
signing or a Developer ID with a matching provisioning profile (notably
`com.apple.security.virtualization` and `com.apple.security.hypervisor`).
brewkit#353 already handles the binary side correctly -- it sees these
entitlements in the Mach-O and forces adhoc signing in fix-machos.rb,
regardless of what signing identity the workflow imported.

This change adds a complementary workflow-level lever: when a caller
knows a recipe needs adhoc only, it can pass `skip-codesign-import: true`
and the Apple Developer ID is never brought into the keychain in the
first place. Avoids importing a cert we won't end up using, and reduces
the window during which the cert exists on the runner.

The default stays false -- behavior of every existing call is unchanged.
This patch only exposes the lever through the call chain:

  pkg.yml (workflow_call input)
    -> pkg-platform.yml (workflow_call input)
      -> .github/actions/setup (composite input, gates the import step)

Picking which recipes opt in is intentionally left out of this patch.
lima-vm.io is the obvious first candidate (see pkgxdev#7853).

Refs: pkgxdev#7853, pkgxdev/brewkit#353

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Decouples cloud-boot's UEFI firmware from qemu's release cadence by
shipping reproducible TianoCore EDK II builds (OvmfPkg X64 + ArmVirtPkg
AARCH64) directly via pkgx. Output layout mirrors qemu's `share/qemu/`
bundle (edk2-x86_64-code.fd, edk2-i386-vars.fd, edk2-aarch64-code.fd,
edk2-arm-vars.fd) so existing runners can pick it up via env-var
overrides without code changes.

Cross-platform via two EDK II toolchains:
  - GCC5     on Linux (uses pantry's gnu.org/gcc)
  - CLANGPDB on Darwin (uses pantry's llvm.org for clang + lld-link,
              sidestepping the macOS-only `mtoc` from XCODE5)

Includes a thin `bin/edk2-firmware-path` shim so pkgx has a discoverable
`bin/*` entry, plus runtime env vars (OVMF_CODE, OVMF_VARS, AAVMF_*).
Test step boots qemu-system-x86_64 with the built firmware over TCG and
greps for the TianoCore banner.

Versioned against `edk2-stableYYYYMM[.N]` tags via match+strip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reproduced the all-platform `brewkit/build` failure locally and fixed
the three root causes:

1. BaseTools built serially. VfrCompile's sub-makefile lacks a dep
   between the dlg-generated VfrLexer.cpp and its compile; under `make
   -j` the compiler reads a half-written file ("VfrLexer.cpp: error:
   expected expression"). Near-deterministic on multi-core runners, so
   every platform was red. The EDK II `build` stays parallel via -n.

2. Added the acpica.org build dep for iasl. OVMF compiles .asl ACPI
   tables to .aml (RamDiskDxe NFIT, ...); without iasl the X64 build
   dies with exit 127 ("iasl: command not found").

3. Fixed the qemu smoke test: dropped `-nographic` (it fights
   `-serial stdio` for stdio and qemu aborts), and pulled in
   gnu.org/coreutils so `timeout` exists on macOS.

Validated on darwin/arm64 (pantry clang 22): OVMF X64 + AArch64 build
clean and the X64 blob boots to BdsDxe under qemu-system-x86_64.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant