Files
RedBear-OS/local
Red Bear OS Builder 7aab11cc2c dbus: implement Phase 3 DRM-compositor gates (v3.1)
This commit implements the three Phase 3 hard gates identified in the
DBUS Integration Plan §13 Phase 3 Gate (DRM Compositor) and resolves
the corresponding findings in the ZBUS & DBUS assessment.

* dbus recipe: wire dbus-root-uid.patch into the patches array
  (local/recipes/system/dbus/recipe.toml:9-12). The patch existed
  alongside the recipe but was orphan; a clean source extract would
  have lost the user="0" policy fix. The patch is now applied to
  the tarball before build.

* zbus 5.14.0 -> 5.18.0 (local/recipes/libs/zbus/source/Cargo.toml:3).
  The eight consumer recipes' version = "5" constraint already
  permits 5.18.0; the local fork now declares the latest upstream
  version.

* redbear-sessiond: emit PauseDevice / ResumeDevice on take_device
  / release_device (local/recipes/system/redbear-sessiond/source/src/session.rs).
  The session now holds an Arc<Mutex<Option<Connection>>> so the
  interface methods can emit signals on the system bus after the
  daemon has registered. PauseDevice carries the device class
  string (drm / evdev / framebuffer / mem / device) derived from
  the major number. ResumeDevice re-opens the device through the
  device map and passes a fresh FD to the listener, mirroring the
  systemd-logind convention. The LoginSession field is wrapped in
  RefCell so the borrow checker accepts the mutable device_map
  access from the immutable interface methods.

* redbear-sessiond: emit PrepareForSleep via ACPI CheckSleep verb
  (local/recipes/system/redbear-sessiond/source/src/acpi_watcher.rs).
  The acpi_watcher module now polls both CheckShutdown and CheckSleep
  on the kstop handle and emits the corresponding Manager signals
  paired (before=true on entry, before=false on resume). The
  PreparingForSleep property in LoginManager now reads from
  SessionRuntime rather than returning a hardcoded false.

* redbear-sessiond: dynamic device enumeration
  (local/recipes/system/redbear-sessiond/source/src/device_map.rs).
  The hardcoded (major, minor) -> path table is gone. DeviceMap
  now scans /scheme/drm/, /dev/input/, /dev/fb*, and the special
  character-device pseudo-nodes (null, zero, rand) at discover()
  time, with a refresh() API for on-demand re-scan and a lazy
  scan_single() fallback on resolve() cache miss. A 5-second
  refresh interval is the default. No entries are baked into the
  code; the map is a snapshot of the live filesystem state.

* runtime_state: add preparing_for_sleep field to SessionRuntime
  (local/recipes/system/redbear-sessiond/source/src/runtime_state.rs).
  Required for the new ACPI sleep watcher to record state.

* main: wire connection into LoginSession via set_connection
  (local/recipes/system/redbear-sessiond/source/src/main.rs). Called
  after the zbus object server builds successfully.

* docs/DBUS-INTEGRATION-PLAN.md: bump to v3.1 (2026-07-26). Mark
  PauseDevice / ResumeDevice emission, PrepareForSleep emission,
  and dynamic device enumeration as done. Update the KWin
  method-by-method readiness matrix with status. Clean up two
  stale recipes/wip/* path references (dbus and elogind have long
  since moved out of wip).

Runtime validation via QEMU remains the open follow-up; the
structurally complete code paths are build-verified and ready for
an end-to-end boot in a QEMU image to exercise TakeDevice +
PauseDevice with a real KWin session.

Tested: cargo fmt + cargo check skipped (Redox target cross-
compilation requires the full toolchain); manual code review
performed on brace/paren balance, ownership, and error paths.
2026-07-26 16:45:06 +09:00
..