hotplugd is the hardware hotplug mediation daemon for EriX.
Find a file
Erik Inkinen 8e445766dc
All checks were successful
CI / test (push) Successful in 5s
CI / security (push) Successful in 1m26s
CI / minimal-versions (push) Successful in 11s
hotplugd: drop unstable rustfmt options for stable toolchains
2026-03-23 10:19:52 +02:00
.github Add CI workflow for testing, security auditing, and minimal version checks 2026-03-10 17:28:31 +02:00
src fix: add conditional compilation for const_max_usize function in baremetal module 2026-03-12 15:24:03 +02:00
.editorconfig Initial commit 2026-03-10 13:30:51 +01:00
.gitignore Initial commit 2026-03-10 13:30:51 +01:00
ARCHITECTURE.md runtime-mode: migrate feature gates and document mode model 2026-03-11 08:05:00 +02:00
Cargo.toml runtime-mode: migrate feature gates and document mode model 2026-03-11 08:05:00 +02:00
CODE_OF_CONDUCT.md Initial commit 2026-03-10 13:30:51 +01:00
CONTRIBUTING.md Initial commit 2026-03-10 13:30:51 +01:00
LICENSE Initial commit 2026-03-10 13:30:51 +01:00
linker.ld Refactor repository for hotplugd service 2026-03-10 17:27:47 +02:00
README.md runtime-mode: migrate feature gates and document mode model 2026-03-11 08:05:00 +02:00
ROADMAP.md runtime-mode: migrate feature gates and document mode model 2026-03-11 08:05:00 +02:00
rustfmt.toml hotplugd: drop unstable rustfmt options for stable toolchains 2026-03-23 10:19:52 +02:00
SECURITY.md docs: align security policy phase numbering 2026-03-11 05:28:11 +02:00

hotplugd

hotplugd is the hardware hotplug mediation daemon for EriX.

It consumes kernel hotplug events through a dedicated kernel-control operation, reports those events to deviced via typed IPC, and exposes deterministic status/counter readback for orchestration checks. Driver lifecycle policy stays in deviced.

Responsibilities

  • Validate startup envelope and role contract (SERVICE_ROLE_HOTPLUGD).
  • Register itself in named and resolve deviced endpoint.
  • Read hotplug events using WAIT_HOTPLUG_EVENT kernel control op.
  • Forward events to deviced REPORT_HOTPLUG.
  • Expose deterministic event accounting through DISCOVER and READ_LAST_EVENT.

IPC Surface

hotplugd serves the following operations from lib-ipc:

  • IPC_PHASE2_HOTPLUGD_OP_DISCOVER
  • IPC_PHASE2_HOTPLUGD_OP_READ_LAST_EVENT

hotplugd consumes:

  • IPC_KERNEL_CONTROL_OP_WAIT_HOTPLUG_EVENT
  • IPC_PHASE2_DEVICED_OP_REPORT_HOTPLUG
  • IPC_PHASE1_NAMED_OP_REGISTER
  • IPC_PHASE1_NAMED_OP_LOOKUP

Runtime Behavior

  • DISCOVER consumes up to caller-provided max_events.
  • Each consumed event is synchronously reported to deviced.
  • Event kinds are validated (INSERTED or REMOVED) before forwarding.
  • READ_LAST_EVENT returns last event metadata and cumulative counters.
  • Empty queue behavior is deterministic (RETRY), not panic-based.

Build

cargo build --all-targets --all-features

Test

cargo test --all-targets --all-features
cargo clippy --all-targets --all-features -- -D warnings

License

ISC.


Build and Test Modes

This repository supports additive runtime and integration feature gates.

  • *-runtime and *-runtime-phase* features select production bootstrap/runtime behavior.
  • *-integration-smoke remains available for synthetic end-to-end validation paths.
  • *-integration-force-fail remains test-only and MUST NOT be enabled for runtime appliance builds.

Compatibility aliases are kept so existing scenario feature names continue to compile while the runtime naming becomes canonical.