qemu: find the kernel + initramfs in the UEFI stone manifest shape - #375
Open
mobileoverlord wants to merge 1 commit into
Open
qemu: find the kernel + initramfs in the UEFI stone manifest shape#375mobileoverlord wants to merge 1 commit into
mobileoverlord wants to merge 1 commit into
Conversation
stone-provision-direct.sh took the pair from the boot FAT image's file
list, matching plain filenames. qemux86-64's move to systemd-boot turned
those entries into {in,out} objects and added top-level images.kernel /
images.initramfs, so jq printed raw JSON, nothing matched, and every
direct provision of that machine failed:
manifest's boot.build_args.files must include a kernel + initramfs entry
Read images.kernel / images.initramfs first, falling back to the file
list for U-Boot machines (qemuarm64), which carry no such keys. The
fallback now unwraps {in,out} objects as well, so a future machine
gaining the ESP layout without the top-level keys still resolves.
scripts/test-stone-provision-direct.sh runs both machines' real scripts
against their real manifests in a fabricated data dir: it reproduces the
failure above on the unfixed script and asserts the x86 kernel resolves
to bzImage, not the systemd-bootx64.efi sitting in the same file list.
mobileoverlord
requested review from
nicksinas
and
a lite review from Copilot
September 8, 2026 17:52
There was a problem hiding this comment.
🟢 Approval recommended
The updated jq lookups match the current manifest shapes for both machines and the added test covers the regression scenario that previously broke qemux86-64 direct provisioning.
Pull request overview
Updates QEMU stone direct provisioning to correctly locate and stage the kernel + initramfs for both qemu machines despite differing manifest shapes (U-Boot vs UEFI/systemd-boot), and adds a regression test that exercises the real scripts against the real manifests.
Changes:
- Teach
stone-provision-direct.shto preferstorage_devices.rootdisk.images.kernel/.initramfswhen present, otherwise fall back to scanningboot.build_args.fileswhile unwrapping{in,out}entries. - Improve the failure message when the manifest doesn’t name a kernel/initramfs in either supported shape.
- Add
scripts/test-stone-provision-direct.shto validate both machines stage the expected artifacts and role links (including guarding against mistakenly selectingsystemd-bootx64.efion x86).
File summaries
| File | Description |
|---|---|
| scripts/test-stone-provision-direct.sh | New integration-style test that runs each machine’s real direct provision script against its real manifest and validates staged outputs/links. |
| meta-avocado-qemu/stone/qemux86-64/stone-provision-direct.sh | Fix kernel/initramfs resolution for UEFI manifest shape (prefer images.kernel/initramfs, else scan file list unwrapping objects). |
| meta-avocado-qemu/stone/qemuarm64/stone-provision-direct.sh | Keep U-Boot behavior working via fallback scan, while sharing the same logic as x86-64. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
What
stone-provision-direct.shread the kernel + initramfs out of the boot FAT image'sbuild_args.files, matching plain filenames.qemux86-64's move to systemd-boot turned those entries into{in, out}objects (and added top-levelimages.kernel/images.initramfs), sojq -rprinted raw JSON, neither pattern matched, and everydirectprovision of that machine failed:qemuarm64is unaffected — it still carries the U-Boot shape, plain filenames, no top-level keys.How
Take
images.kernel/images.initramfswhen present, else fall back to scanning the file list, unwrapping{in, out}objects as well as plain strings. A machine that later gains the ESP layout without the top-level keys still resolves. Both machines' copies of the script are identical, so both are patched.scripts/test-stone-provision-direct.shruns each machine's real script against its real manifest in a fabricated data dir.Results
On the unfixed script the same test reproduces the CI failure exactly:
The x86 assertion is the regression guard: the kernel must resolve to
bzImage, not thesystemd-bootx64.efisitting in the same file list.Not build-tested — the change is provision-time shell and stone data, no recipe or task logic. The consumer is avocado-vm's
directprofile, whose x86-64 build is red on the 2026/next feed for exactly this reason and needs a re-lock once this is in a snapshot.