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.
redbear-session-launch
Session bootstrap helper — uid/gid/env/runtime-dir handoff
Status: FEATURE-INCOMPLETE
Category: system
Build: cargo build --release --manifest-path source/Cargo.toml
Purpose
redbear-session-launch is the Red Bear session bootstrap binary. It loads a user account from /etc/passwd, resolves supplementary group memberships from /etc/group, creates an XDG-compliant runtime directory with correct ownership, builds a full desktop environment variable set, and then exec()s into the target session command (KDE on Wayland) or an arbitrary program with the correct uid/gid/supplementary groups. It is invoked by redbear-authd after successful authentication and by redbear-greeterd to launch the compositor and greeter UI as the greeter user.
Command Line
redbear-session-launch --username USER [--mode session|command] [--session kde-wayland]
[--vt N] [--runtime-dir PATH] [--wayland-display NAME]
[--command PROGRAM [ARGS...]]
| Flag | Description |
|---|---|
--username USER |
Required. User to launch as. |
| `--mode session | command` |
--session NAME |
Session type (currently only kde-wayland is supported). Sets XDG_CURRENT_DESKTOP=KDE. |
--vt N |
Virtual terminal number (default: 3). |
--runtime-dir PATH |
Override the XDG runtime directory (default: /run/user/<uid> or /tmp/run/user/<uid>). |
--wayland-display NAME |
Wayland display socket name (default: wayland-0). |
--command PROGRAM [ARGS...] |
In command mode, the program and arguments to execute. |
Architecture
Single-file Rust binary (src/main.rs, ~609 lines). No async runtime — synchronous execution model culminating in exec().
Key types:
Account— username, uid, gid, home directory, shellGroupEntry— gid + member usernamesLaunchMode—SessionorCommand { program, args }Args— parsed CLI arguments
Flow:
- Parse CLI arguments
- Load account from
/etc/passwd(dual-format: Redox;+ Unix:) - Load supplementary groups from
/etc/group(intersection of primary gid and group memberships) - Create XDG runtime directory with
mkdir+chown+chmod 700 - Build environment map:
- Standard:
HOME,USER,LOGNAME,SHELL,PATH - XDG:
XDG_CONFIG_HOME,XDG_CACHE_HOME,XDG_STATE_HOME,XDG_RUNTIME_DIR,XDG_CURRENT_DESKTOP,XDG_SESSION_TYPE,XDG_SESSION_ID - Wayland:
WAYLAND_DISPLAY - KDE:
KDE_FULL_SESSION=true - Seat:
LIBSEAT_BACKEND=seatd,SEATD_SOCK=/run/seatd.sock - Propagated:
KWIN_DRM_DEVICES,XCURSOR_THEME,XKB_CONFIG_ROOT,QT_PLUGIN_PATH,REDBEAR_DRM_WAIT_SECONDS
- Standard:
- Build command: for
sessionmode →/usr/bin/dbus-run-session -- /usr/bin/redbear-kde-session(or direct ifdbus-run-sessionmissing) exec()withuid()/gid()setters +pre_execforsetgroups()(Linux host only; Redox target omitssetgroupssince the syscall is not yet implemented)
Dependencies: libc only.
Status Notes
- Core functionality: Account loading, supplementary group resolution, runtime directory creation, environment setup, command selection, and
exec()handoff all implemented. - Session types: Only
kde-waylandis supported. Other session names return an error. - Dual-format parsing: Supports both Redox (
;) and Unix (:) account file formats. - setgroups: Applied on Linux host only. Redox target omits the call (
redox_syscallSYS_SETGROUPS not yet implemented). - Tests: 11 unit tests covering CLI parsing (session mode, command mode, error cases), passwd parsing (Unix + Redox formats), group parsing, environment construction (session + command modes), KWIN_DRM_DEVICES propagation, and unsupported session names.
Consumers
redbear-authd— launches user desktop sessions after successful authenticationredbear-greeterd— launches greeter compositor and UI as the greeter user
Cross-reference: local/docs/GREETER-LOGIN-IMPLEMENTATION-PLAN.md