Skip to content

Headless firmware rootfs and DHCP renewal through dhcpcd - #80

Merged
Rust-KVM merged 5 commits into
devfrom
claude/project-thread-y73rbn
Oct 24, 2026
Merged

Rust-KVM merged 5 commits into
devfrom
claude/project-thread-y73rbn

Conversation

@Rust-KVM

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

Copy link
Copy Markdown
Owner

Requested by 4c

Summary

Before: the firmware rootfs was FriendlyElec's full Buildroot desktop/evaluation set (Weston, Chromium, Mali, NPU, camera ISP, ffmpeg, PulseAudio, Bluetooth, benchmarks, CJK fonts). rootfs.img was 942 MB, Weston alone held about 107 MB of RAM, and the app was serving its web UI about 19 s after power-on. "Renew DHCP lease" started a second DHCP client next to dhcpcd, and Settings → About showed no system version.

After: the rootfs keeps only what rustkvm_app and its boot scripts use. Measured on a flashed unit: rootfs.img is 216 MB (the Buildroot part is 31 MB), userspace outside the app takes about 15 MB of RAM, and the web UI is up about 9 s after power-on. 4K60 video, audio, HID, USB, virtual media, both NICs, chrony and the web terminal all work. Lease renewal goes through dhcpcd, and the firmware writes /etc/rustkvm-version.

How

  • os/rk3588/patches/buildroot/0002: the only RK3588 defconfig is now headless. Its package list comes from the app's process maps on a running unit and from every external command the app and the kept init scripts run. The old full defconfig is gone, along with the patches that only served it: the fragment edits, the uvc-gadget build fixes, the rkupdate legal-info fix and the rockit link fix (external/). gst.sh keeps RGA in videoconvert.
  • os/rk3588/patches/device/friendlyelec/0002: rustkvm-slim runs last and removes the prebuilt tools in /usr/local/bin, the fonts, the demo media and the PulseAudio/usbdevice leftovers.
  • scripts/build-firmware.sh: rebuilds the Buildroot output from scratch whenever the defconfig hash changes. An existing tree used to keep its old .config and the files of dropped packages, which also silently ignored a new root password. It now also writes /etc/rustkvm-version.
  • app/src/api/handlers/network.rs: DHCP renewal asks the running dhcpcd to rebind, with udhcpc as the fallback.
  • Cargo.lock/deny.toml: fixes for the advisories published since dev last went green (tokio, rustls-webpki, webpki-roots). Two have no compatible fixed release, rumqttc's pinned rustls-webpki 0.102 and crypto-bigint 0.5 under webrtc's dtls; both are ignored with a written rationale, like the existing rumqttc entries.

Testing

  • cargo +nightly fmt --all
  • cargo +nightly clippy --workspace --release --all-targets -- -D warnings (CI)
  • cargo +nightly test --workspace (CI)
  • Frontend touched: not applicable
  • Tested on an RK3588 device: flashed the full image built from this branch, then checked over the HTTP RPC and SSH. Video ran at 3840×2160 at 60 fps, audio frames kept flowing, USB HID was configured and read the host's LED state, and the terminal opened. Both NICs had addresses and routes, there was a single dhcpcd, chrony was synced, the fan was under thermal control, and dmesg showed no new errors.

Checklist

  • No #[allow(...)] suppressions and no new unwrap() / expect() in production paths
  • Hot paths stay zero-copy (not touched)
  • Shared protocol types live in rkvm-proto (not touched)
  • RPC method set unchanged
  • Firmware layer documented in os/rk3588/README.md

🤖 Generated with Claude Code

The slim Buildroot image makes dhcpcd the only DHCP client. Renewing
with a one-shot udhcpc put a second client on eth0; ask the running
dhcpcd to rebind instead, and keep udhcpc for older images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the area: api JSON-RPC, HTTP routes, MCP, MQTT label Oct 23, 2026
@Rust-KVM Rust-KVM self-assigned this Oct 23, 2026
buildroot 0004 replaces the RK3588 defconfig with a headless one: MPP,
RGA, the GStreamer plugins the app loads, ALSA, chrony, dhcpcd and
dropbear. Weston, Chromium, Mali, NPU, ISP, rockit, PulseAudio,
Bluetooth, the update engine, uvc-gadget, benchmarks and fonts go;
nothing in the app or its boot scripts calls them.

device/friendlyelec 0002 adds a last rustkvm-slim overlay step that
deletes what device/rockchip installs unconditionally (/usr/local/bin
tools, fonts, demo media) and drops the PulseAudio and usbdevice
overlays.

build-firmware.sh now starts the Buildroot output over when the
defconfig changes; mk-buildroot.sh reuses an existing .config and
Buildroot never removes files of disabled packages, so neither this
change nor a new root password took effect on an existing SDK tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 23, 2026
@Rust-KVM Rust-KVM changed the title fix(network): renew the DHCP lease through dhcpcd when it runs Headless firmware rootfs and DHCP renewal through dhcpcd Oct 23, 2026
foxxcn and others added 3 commits October 24, 2026 14:42
The app reads /etc/rustkvm-version, the firmware only wrote
/etc/rustkvm-release, so system_version came back null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fold the headless defconfig into buildroot 0002 against the pinned SDK
and remove what only served FriendlyElec's desktop/evaluation config:
the old full defconfig and its fragment edits (update engine, Opus in
the PulseAudio fragment, dropbear client in network.config), the
uvc-gadget build fixes, the rkupdate legal-info fix and the rockit link
fix. None of those packages are built any more. The resulting
defconfig is byte-identical to the one on the verified image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment two unfixable advisories

New advisories since dev last went green: RUSTSEC-2026-0386 (tokio),
-0382 and -0381 (distrusted emSign roots/intermediates) are fixed by
the updates. -0382 also hits the 0.102 copy that rumqttc 0.25.1 (the
latest) pins, and -0387 (crypto-bigint 0.5 timing) comes through
webrtc 0.17.2's dtls; neither has a compatible fixed release, so both
are ignored with their reach written down, like the earlier rumqttc
entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the build Toolchain, cross-compilation and packaging label Oct 24, 2026
@Rust-KVM
Rust-KVM marked this pull request as ready for review October 24, 2026 08:23
@Rust-KVM
Rust-KVM merged commit 242631e into dev Oct 24, 2026
8 checks passed
@Rust-KVM
Rust-KVM deleted the claude/project-thread-y73rbn branch October 24, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: api JSON-RPC, HTTP routes, MCP, MQTT build Toolchain, cross-compilation and packaging documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants