Repository navigation
Find the bootstrap slot by its sector headers: - #77
Merged
mergify[bot] merged 2 commits intoOct 15, 2026
Merged
Conversation
Tinkerbell needed a layout file published with every ISO to find the slot. Fetching, caching and keeping that file in step with the ISO, across redirects and ISOs replaced in place, was where most of Tinkerbell's complexity and failure modes came from. Every sector of the slot now starts with a header identifying it, so Tinkerbell finds the slot in the bytes it serves, as it already does the kernel arguments, and no layout file is published. Each header is an empty cpio archive, so an ISO served unmodified still boots. The build checks that the slot is stored intact and sector aligned, and that nothing else in the ISO looks like one of its headers. An ISO that fails the check is removed, and an existing ISO is only reused when it passes. Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
3 tasks
There was a problem hiding this comment.
🟡 Changes recommended
Interrupted builds can leave incomplete ISOs that pass slot validation and are subsequently reused.
1 open finding
What changed in this PR
Replaces bootstrap-slot layout sidecars with sector headers so Tinkerbell can locate the slot directly in ISO bytes.
Changes:
- Adds sector headers and validates slot integrity, alignment, and uniqueness.
- Validates existing ISOs before reuse.
- Removes layout sidecars from artifact collection and CI uploads.
| File | Description |
|---|---|
| captain/iso.py | Generates sector headers and validates bootstrap slots. |
| captain/flavor.py | Removes layout sidecars from artifact listings. |
| captain/cli/stages.py | Checks slots before reusing existing ISOs. |
| captain/artifacts.py | Stops collecting layout sidecars. |
| .github/workflows/ci.yml | Uploads only the ISO artifact. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
grub-mkrescue wrote straight to the final path, so a build that failed or was interrupted after writing the bootstrap slot left a truncated ISO whose slot still passes the check, and a later build reused it. Build and check the ISO under a .partial name and move it into place only when both succeed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
Contributor
Merge Queue Status
This pull request spent 26 minutes 2 seconds in the queue, including 25 minutes 15 seconds running CI. Required conditions to merge
|
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.

Description
Tinkerbell needed a layout file published with every ISO to find the slot. Fetching, caching and keeping that file in step with the ISO, across redirects and ISOs replaced in place, was where most of Tinkerbell's complexity and failure modes came from.
Every sector of the slot now starts with a header identifying it, so Tinkerbell finds the slot in the bytes it serves, as it already does the kernel arguments, and no layout file is published. Each header is an empty cpio archive, so an ISO served unmodified still boots.
The build checks that the slot is stored intact and sector aligned, and that nothing else in the ISO looks like one of its headers. An ISO that fails the check is removed, and an existing ISO is only reused when it passes.
Fixes: #
How Has This Been Tested?
How are existing users impacted? What migration steps/scripts do we need?
Checklist:
I have: