Files
RedBear-OS/local
Red Bear OS Builder db5f289d46 d-bus: redbear-udisks mount/unmount + notifications ActionInvoked (v3.3)
This commit implements three previously-stubbed areas identified in the
DBUS assessment:

* redbear-udisks Mount/Unmount (real implementation). The org.freedesktop.
  UDisks2.Block interface had no mount/unmount methods. New
  implementation:
  - mount.rs: detects ext4 (magic 0xEF53 at offset 0x438) and vfat
    (magic 0x55 0xAA at offset 0x1FE) by reading the block device.
  - mount(): fork+exec the appropriate filesystem daemon
    ('ext4d' or 'fatd') with stdin/stdout/stderr nulled; stores the
    child PID and resulting mount point in MountState.
  - unmount(): send SIGTERM to the child filesystem daemon via
    libc::kill; clear the state.
  - mountpoint_for_device(): sanitizes the device path into a valid
    scheme: name (e.g. 'udisks_disk_sata0p1').
  - 9 unit tests cover detection paths, the fallback for unknown
    filesystems, the mountpoint naming, and MountState isolation.
  - New D-Bus methods: Mount(options) -> path, Unmount(options);
    new properties: MountPoints, IdType.

* redbear-notifications ActionInvoked emission. The signal was declared
  via the zbus macro but never emitted. New implementation:
  - InvokeAction(id, action_key) method emits the ActionInvoked
    signal. This is the standard UDisks2/org.freedesktop.Notifications
    mechanism by which an external notification UI (e.g. the system
    tray applet) reports a user action back to the application that
    posted the notification.
  - ServerVersion bumped to 0.2.0.
  - Capabilities list adds 'persistence' (spec-defined capability).

* redbear-statusnotifierwatcher unit tests. The daemon had no
  coverage for its registration state machine. Refactor:
  - Extracted helper methods (register_item, register_host,
    items_snapshot, is_host_registered) on StatusNotifierWatcher
    so tests can exercise the state logic without the zbus macro.
  - 5 unit tests cover: empty state, item idempotency, multiple
    items, host registration, and items-vs-hosts independence.

DBUS-PLAN bumped to v3.3 (2026-07-26). The status table now lists:
- redbear-udisks v0.2 with Mount/Unmount/MountPoints/IdType
- redbear-notifications v0.2 with ActionInvoked emission
- redbear-statusnotifierwatcher with 5 unit tests

The fragility-rating table at the bottom of the plan is updated:
- redbear-polkit 5/5 security -> ' v0.2 real authorization'
- redbear-notifications 2-3/5 -> ' v0.3 ActionInvoked emission'
- redbear-udisks 2-3/5 -> ' v0.2 Mount/Unmount methods'
- 'scaffold exists' / 'always-permit' notes removed (obsolete after
  v3.2 and v3.3 work).

The 'What Exists But Is Incomplete' table (§3.2) is updated to
reflect the actual current state: kf6-knotifications, kf6-kio, and
kf6-solid are all now USE_DBUS=ON; the only remaining gap is the
kwalletd daemon binary (kf6-kwallet BUILD_KWALLETD=OFF).

Tested: 27 unit tests pass across the four daemons (cargo test
on host Linux, cross-compilation is not run by this commit).
2026-07-26 20:32:20 +09:00
..