Skip to content

firmware: first end-to-end build fixes; ship the app in the rootfs - #67

Merged
Rust-KVM merged 4 commits into
devfrom
claude/project-thread-9dvesw
Oct 18, 2026
Merged

Rust-KVM merged 4 commits into
devfrom
claude/project-thread-9dvesw

Conversation

@Rust-KVM

@Rust-KVM Rust-KVM commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Requested by 4c

Summary

Before: scripts/devkit.sh firmware stopped at several points on a clean checkout (missing xxd, a shallow mpp clone, no loop partition nodes, root-owned objects from the SDK's second build pass). Even a finished image would have booted without the app, because the binary sat in a rootfs directory that the empty /userdata partition is mounted over.

After: the first end-to-end build from public sources produced the SD image (425 MB) and the eMMC flasher image (713 MB). A freshly flashed board installs rustkvm_app to /userdata on first boot from a factory copy in /usr/lib/rustkvm/.

How

  • os/rk3588/rootfs-overlay/etc/init.d/S99rustkvm: copies /usr/lib/rustkvm/rustkvm_app to /userdata/rustkvm/bin/ when missing (first boot, wiped userdata).
  • scripts/build-firmware.sh: installs the binary into the overlay instead of the userdata staging dir; builds u-boot, kernel and Buildroot as the build user and only packs images as root (the SDK's ./build.sh <board>.mk reruns everything under sudo); reclaims root-owned files from earlier runs; names output files after the version baked into the image.
  • scripts/devkit.sh: firmware container gets the host /dev so loopNpM nodes exist.
  • ci/firmware/Dockerfile: adds xxd (camera-engine-rkaiq).
  • os/rk3588/manifest.xml: clone-depth="30" for mpp, whose CMake embeds recent commit subjects.
  • os/rk3588/patches/buildroot/0003: rkupdate's license file is LICENSE, not the missing NOTICE, so make legal-info completes; the legal-info bundle leaves out host-tool sources.

Testing

  • Full firmware build in the container on the workbench: u-boot, kernel, Buildroot, SD and eflasher images.

  • Inspected the rootfs of the first image with debugfs: /etc/rustkvm-release, S99rustkvm present, root password locked (*), and userdata.img empty, which exposed the hidden-binary problem fixed here. The rebuilt image is checked the same way before release.

  • Not flashed to hardware yet.

  • No Rust changes.

  • cargo +nightly fmt --all

  • cargo +nightly clippy --workspace --release --all-targets -- -D warnings

  • cargo +nightly test --workspace

  • Frontend touched: trunk build --locked and wasm32 clippy in crates/rkvm-web. Not applicable.

  • Tested on an RK3588 device (describe below), or not applicable. Pending: first flash.

Checklist

  • No #[allow(...)] suppressions and no new unwrap() / expect() in production paths
  • Hot paths stay zero-copy; periodic loops use MissedTickBehavior::Delay
  • Shared protocol types live in rkvm-proto
  • RPC method set changed → app/tests/rpc_methods.txt updated
  • Module tree or build invariants changed → AGENTS.md updated

🤖 Generated with Claude Code

foxxcn and others added 3 commits October 18, 2026 01:24
The rkaiq build embeds its IQ binary with xxd, which the Ubuntu base image
does not have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mpp's CMakeLists embeds the last few commit subjects in its version string
and fails to configure on a depth-1 clone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- /userdata is an empty partition mounted over the rootfs directory, so a
  binary placed there by the build was hidden and a freshly flashed board
  had no rustkvm_app. The image now carries /usr/lib/rustkvm/rustkvm_app
  and S99rustkvm installs it to /userdata on first boot or after a wipe.
- build step: select the board and build u-boot, kernel and Buildroot as
  the build user; `./build.sh <board>.mk` repeats the whole build as root
  and leaves root-owned objects that break the next run.
- devkit.sh firmware mounts the host /dev so loop partition nodes exist.
- collect names the images after the version baked into the image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rust-KVM Rust-KVM self-assigned this Oct 17, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci CI workflows and checks labels Oct 17, 2026
@Rust-KVM
Rust-KVM marked this pull request as ready for review October 17, 2026 20:04
rkupdate declared a NOTICE license file that does not exist, which aborted
`make legal-info`. Point it at LICENSE, and leave host-tool sources out of
the legal-info bundle (632 MB for v0.1.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rust-KVM
Rust-KVM merged commit 81c7fab into dev Oct 18, 2026
8 checks passed
@Rust-KVM
Rust-KVM deleted the claude/project-thread-9dvesw branch October 18, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI workflows and checks documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants