Skip to content

network: replace connman with rxnm, delegate IWD to L2-only#2369

Open
aenertia wants to merge 1 commit intoROCKNIX:nextfrom
aenertia:rxnm-introduction
Open

network: replace connman with rxnm, delegate IWD to L2-only#2369
aenertia wants to merge 1 commit intoROCKNIX:nextfrom
aenertia:rxnm-introduction

Conversation

@aenertia
Copy link
Contributor

@aenertia aenertia commented Mar 3, 2026

Replace ConnMan with rxnm v1.1.1 + systemd-networkd as the network management stack. This is a minimal introduction for full replacement — all user and low-level networking functionality works exactly as it does pre-rxnm (and in several cases, better).

rxnm delegates L3 (DHCP, addressing, routing) to systemd-networkd and keeps IWD in L2-only mode for WiFi authentication. Standard networkd .network templates handle all interface types — WiFi station, ethernet, USB gadget, Bluetooth PAN, AP/hotspot — automatically via template matching, without user interaction. Zero-touch unless the user wants to customize, in which case it is standard networkd config overrides.

This eliminates ConnMan's 7MB daemon and glib/ncurses/readline deps, replacing them with ~150KB of shell libraries and a 50KB native C agent. Measured on RK3566 hardware: 7.8 MiB RSS saved, 5 MiB less system memory used, 23 fewer CPU jiffies at idle — lighter across every dimension.

Changes:

  • systemd: enable networkd (-Dnetworkd=true, -Dlink-networkd-shared=true)
  • systemd: strip networkd-wait-online (boot must not block on network)
  • systemd: preserve /usr/lib/systemd/network/ for rxnm templates
  • systemd: add networkd.conf.d override symlink
  • iwd: set EnableNetworkConfiguration=false (L2-only, networkd does DHCP)
  • iwd: add explicit dbus.service dependency
  • virtual/network: swap connman for rxnm (connman package left in-tree)
  • rxnm: add v1.1.1 package with systemd units, network templates, suspend/resume hook, bash completion
  • network-base-setup: ensure runtime directories exist

Hardware validated on RK3566 across multiple boot cycles: WiFi station (WPA3), USB ethernet hotplug, local-play AP mode, dual-homed routing, profile save/load, DNS via systemd-resolved, nullify enable/disable. EmulationStation WiFi UI works unchanged — no ES modifications needed.

make world passes for all 9 targets (RK3588, RK3566, RK3326, RK3399, S922X, SM8250, SM8550, H700, SM8650).

Note: XDP/eBPF kernel module support for nullify power management modes will come in a separate patchset. This change focuses solely on the ConnMan-to-rxnm network stack replacement.

rxnm upstream: https://codeberg.org/aenertia/rxnm (v1.1.1 tagged) CI: https://github.com/aenertia/rxnm/actions (unit, POSIX, shellcheck,
wired/bridge integration, virtual WiFi hwsim, bundle interop)

Extensive benchmarks and docs at the codeburg.

Rocknix CI kicked off and building here : https://github.com/aenertia/distribution/actions/runs/22613457258

Description=Wireless service
Documentation=man:iwd(8) man:iwd.config(5) man:iwd.network(5) man:iwd.ap(5)
After=network-pre.target
After=network-pre.target dbus.service
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually fixes a bug in current unit - which can trigger cycle issues in some situations

[Install]
WantedBy=multi-user.target
SVCEOF

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it best to keep this in-line within the package to simplify install. Am happy to move this separately

# Bash completion
mkdir -p ${INSTALL}/usr/share/bash-completion/completions
cp ${PKG_BUILD}/usr/share/bash-completion/completions/rxnm ${INSTALL}/usr/share/bash-completion/completions/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works fine without the bash completion. But it's much nicer with it.

safe_remove ${INSTALL}/usr/lib/systemd/systemd-networkd-wait-online
safe_remove ${INSTALL}/usr/lib/systemd/system/systemd-networkd-wait-online.service
safe_remove ${INSTALL}/usr/lib/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Belt and suspenders approach needed here since we are no-longer using a top-level glob

Replace ConnMan with rxnm v1.1.1 and systemd-networkd for network management:
- rxnm handles L3 operations (DHCP, routing) via systemd-networkd
- IWD operates in L2-only mode for WiFi authentication
- networkd templates auto-configure all interface types
- Eliminates ConnMan's 7MB daemon and dependencies (glib, ncurses, readline)

rxnm.service extracted to system.d/ directory following ROCKNIX packaging
convention. TimeoutStopSec=1s added to rxnm.service and systemd-networkd
(via drop-in override) to align with systemd aggressive shutdown policy.

Validated: RK3566 across multiple boot cycles (WiFi WPA3, USB hotplug,
AP mode, routing, DNS via systemd-resolved). make world passes all targets.
@aenertia aenertia force-pushed the rxnm-introduction branch from 304bcf7 to d6ff4b3 Compare March 9, 2026 19:50
@aenertia
Copy link
Contributor Author

aenertia commented Mar 9, 2026

Nothing rxnm code related - just some packaging tweaks.

  • rxnm.service extracted from inline heredoc to system.d/rxnm.service (follows avahi/bluez/openssh convention)
  • TimeoutStopSec=1s added to rxnm.service and systemd-networkd (via drop-in override.conf)
  • Rebased onto current dev — picks up the aggressive-shutdown merge (iwd + resolved already have 1s)
  • Zero heredocs remaining in package.mk
  • All 4 network services aligned at 1s shutdown timeout

@aenertia
Copy link
Contributor Author

aenertia commented Mar 9, 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