Skip to content

Compose Stage 2 with matching kernel DTBs and component provenance - #28

Merged
RyanTheTide merged 2 commits into
mainfrom
fix/stage2-matching-dtbs
Oct 31, 2026
Merged

RyanTheTide merged 2 commits into
mainfrom
fix/stage2-matching-dtbs

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Kernel-only updates leave the embedded Stage 2 DTB set unchanged. A newly enabled DT-driven kernel provider can consequently bind without the properties added by the matching DTS; the PMP DRAM attributes from linux#656 are one example. Refreshing /boot/dtb alone does not replace a DTB already appended to the Aura/U-Boot payload.

Add tools/compose_stage2.py for that payload route. It requires explicit kernel-build DTBs and a full kernel source revision, accepts a bare ESP Stage 2 image and raw ARM64 u-boot-nodtb.bin, and emits a deterministic payload plus a manifest of component hashes, sizes and offsets. An already appended Aura image is rejected so stale embedded DTBs cannot be carried forward accidentally. Newline configuration variables remain optional, without an early NUL terminator that would hide Stage 1 handoff variables. The caller still owns build provenance and static DT review; the tool does not infer board support or invent missing DT properties.

Include the composer and refresh guide in release packages. The guide covers rebuilding the DT set, inspecting the expected PMP/OPP metadata, the distinction from direct boot= DTB loading, and deployment to the Stage 2 path selected by Stage 1 with the existing rollback/bootguard process. There is no installer or reboot action in this tool. The kernel parser remains unchanged: absent DT metadata means no dram/ group.

Validation: 21 focused pytest cases pass, covering exact multi-DTB placement, replacement of an older DT, gzip round-trip and determinism, manifest hashes, malformed/truncated FDT headers, appended/Stage 1 images, invalid variables, unpinned revisions, duplicate DTB names, and output overwrite refusal. Release-package checks verify the tool and guide are included and hashed. A local composition with freshly compiled T6040/J616s and T8140/J700 DTBs also succeeds; no hardware installation or boot result is claimed.

Related kernel fix: aurora-silicon/linux#661

Current-head CI passes: test matrix (Linux GCC 540 passed, Linux LLVM 539 passed, both macOS jobs 512 passed each, native ARM64 start.S passed), build, release packaging, and formatting. Platform-specific skips remain visible in the CI logs.

Embedded U-Boot payload DTBs survive a kernel-only upgrade. This can leave DT-driven providers bound but without metadata added by newer DTS, including the PMP DRAM class properties.

Provide a reusable composer that requires freshly supplied DTBs and a kernel revision, rejects an already appended Aura image, and records component hashes and offsets. Include it and the refresh instructions in release packages. Preserve newline handoff variables without adding a terminator that would hide Stage 1 configuration.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The J700 package names the guide ESP-AND-INSTALL.md while the release archive retains docs/j700-install.md. Avoid a link valid in only one layout.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit 1a2981c into main Oct 31, 2026
11 checks passed
@RyanTheTide
RyanTheTide deleted the fix/stage2-matching-dtbs branch October 31, 2026 12:02
@RyanTheTide RyanTheTide mentioned this pull request Nov 1, 2026
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