Files
RedBear-OS/local/recipes/system/redbear-greeter
vasilito 7b8a1b2838 release: open 0.3.2 and sync Cat 1/Cat 2 version labels
New release branch per the release-branch model (operator decision;
local/AGENTS.md reserves branch creation to the operator).

sync-versions.sh, driven by bump-release.sh, rewrites:
  - Cat 1 in-house crates  -> version = 0.3.2
  - Cat 2 upstream forks   -> <upstream-tag>+rb0.3.2

Labels only; no fork source was rebased in this commit. bump-release.sh
reports these forks as having newer upstream tags, to be taken next:
  relibc   0.2.5  -> 0.6.0
  syscall  0.9.0  -> 0.9.1
  libredox 0.1.18 -> 0.1.19
redoxfs and redox-scheme are already current. kernel, bootloader and
installer are 'diverged' in the fork map and stay report-only (manual
rebase); bootloader additionally has no merge-base with upstream.
2026-08-03 11:04:40 +03:00
..

redbear-greeter

Login greeter orchestrator — manages compositor, UI, and authentication flow

Status: FEATURE-INCOMPLETE Category: system Build: cargo build --release --manifest-path source/Cargo.toml (greeterd daemon) + CMake build for Qt greeter UI

Purpose

redbear-greeter is the Red Bear login greeter stack, composed of three components:

  1. redbear-greeterd — the greeter orchestrator daemon (Rust). Binds a Unix socket at /run/redbear-greeterd.sock, accepts JSON GreeterRequest/GreeterResponse messages, and manages the full greeter lifecycle: starting the Wayland compositor, launching the Qt-based greeter UI, delegating authentication to redbear-authd, and launching user sessions via redbear-session-launch.
  2. redbear-greeter-ui — the Qt 6 graphical login UI (C++, CMake). Displays the login form with Red Bear branding (background + icon from local/Assets/images/).
  3. redbear-greeter-compositor — the Wayland compositor wrapper script that sets up the display for the greeter on the correct VT.

Protocol

The greeter daemon speaks JSON over a Unix socket:

GreeterRequest Types

Type Fields Description
hello version Client handshake — returns background/icon paths, session name, current state
submit_login username, password Submit credentials for authentication
request_shutdown (none) Request system shutdown
request_reboot (none) Request system reboot

GreeterResponse Types

Type Fields Description
hello_ok background, icon, session_name, state, message Successful handshake
login_result ok, state, message Authentication result
action_result ok, message Power action result
error message Error response

Architecture

GreeterDaemon (Rust, src/main.rs, ~704 lines):

State machine:

Starting → GreeterReady → Authenticating → LaunchingSession → SessionRunning → ReturningToGreeter
                                                                                    ↓
                                                                              PowerAction/FatalError

Lifecycle:

  1. Starting — bind Unix socket at /run/redbear-greeterd.sock, chown to greeter user
  2. Spawn redbear-greeter-compositor as greeter user via redbear-session-launch --mode command
  3. Wait for Wayland socket (primary: $RUNTIME_DIR/wayland-0, fallback: /tmp/run/wayland-0) — up to 45s timeout
  4. Spawn redbear-greeter-ui as greeter user
  5. Activate VT via inputd -A <vt>
  6. Enter GreeterReady — accept hello and submit_login requests from the greeter UI

Authentication flow:

  1. UI sends submit_login { username, password } → greeterd forwards as AuthRequest::Authenticate to redbear-authd over /run/redbear-authd.sock
  2. On success → LaunchingSession state → sends AuthRequest::StartSession to authd → authd spawns redbear-session-launch --mode session
  3. On session exit → ReturningToGreeter → restart compositor + UI

Power actions: Delegates request_shutdown/request_reboot to authd as AuthRequest::PowerAction.

Compositor restart protection: Tracks restart attempts with timestamps. More than 5 restarts in 30s triggers FatalError.

Dependencies: redbear-login-protocol (local), libc, serde/serde_json.

Qt UI build: The recipe uses a custom template with CMake for the Qt 6 greeter UI. Requires qtbase, qtdeclarative, qtwayland. Installs branding assets (background.png, icon.png) from local/Assets/images/.

Consumers

  • redbear-full init system — wired as service 20_greeter.service, started as redbear-greeterd with VT and REDBEAR_GREETER_USER env vars
  • Qt greeter UI — connects to greeterd's Unix socket for the login flow
  • redbear-authd — receives forwarded authentication requests
  • KDE session — launched on successful authentication

Status Notes

  • Greeter daemon: Fully implemented. State machine, socket management, compositor/UI lifecycle, authentication delegation, power actions, restart protection all present.
  • Qt greeter UI: Builds via CMake with Qt 6.11.1. Runtime validation pending — blocked on Qt6 Wayland protocol crash (null+8 in wl_proxy_add_listener).
  • Wayland compositor: redbear-greeter-compositor wrapper script. Socket detection supports both the runtime dir path and the /tmp/run fallback.
  • QEMU proof: test-greeter-qemu.sh validates GREETER_HELLO=ok and GREETER_VALID=ok via the bounded QEMU proof harness.
  • Account format: Dual-format parsing (Redox ; + Unix :) for /etc/passwd uid/gid lookup.
  • D-Bus: The greeter daemon itself does not use D-Bus — it speaks only the Unix-socket JSON protocol to authd and the greeter UI. Session registration on D-Bus is handled by redbear-session-launchredbear-sessiond.

Cross-reference: local/docs/GREETER-LOGIN-IMPLEMENTATION-PLAN.md