Files
RedBear-OS/local/docs/REDBEAR-FULL-SDDM-BRINGUP.md
T

9.2 KiB

redbear-full → SDDM Wayland greeter: bring-up campaign

Goal: make redbear-full compile and wire every component so a run shows the SDDM Wayland login prompt, on either VirGL (QEMU virtio-gpu) or Intel.

Runtime chain: redox-drm/scheme/drm/card0 → Mesa (GBM/EGL/llvmpipe) → KWin (Wayland, KWIN_DRM_DEVICES=/scheme/drm/card0) → SDDM greeter (Qt6/Wayland). Greeter service = 21_sddm.service; seat = seatd.

Grounded in four investigations (2026-07-24): Mesa port, DRM provider, build efficiency, upstream forks. Key correction to stale memory: the Mesa EGL/DRI with_dri gate is already solved in-tree (redox added to system_has_kms_drm); the frontier has moved to Qt6-on-Wayland (see QT6-WAYLAND-NULL8-DIAGNOSIS.md).

Component homes

  • redox-drm (DRM provider, /scheme/drm/card0): local/recipes/gpu/redox-drm/ — cargo. Built-in AMD+Intel+VirtIO KMS drivers; ioctl ABI matches KWin + redbear-compositor.
  • mesa (EGL/GBM/llvmpipe): local/recipes/libs/mesa/ (26.1.4) + local/patches/mesa/.
  • Qt6: local/recipes/qt/{qtbase,qtdeclarative,qtwayland} + local/patches/qtbase/.
  • KF6/KWin/SDDM: local/recipes/kde/.
  • Compositor: local/recipes/wayland/redbear-compositor/ — cargo.
  • Config: config/redbear-full.toml; driver match table local/config/drivers.d/30-graphics.toml.

Phase status

Phase Item Status
0 Build system: stop llvm21/toolchain re-cook on every relibc/base bump (TOOLCHAIN_PRESERVE + REDBEAR_FORCE_TOOLCHAIN_RECOOK escape) DONE f6b09ff7
1a Mesa EGL gate persisted as tracked patch 08-meson-redox-kms-drm.patch (was untracked in-place edit, lost on re-extract) DONE 74d5e01b
1b Mesa build — clear next blockers (libdrm dep now required; GBM backend; wayland-scanner: patch 07 is stale vs 26.1.4 layout, recipe uses $WAYLAND_SCANNER env — verify) TODO (needs cook)
2 VirGL determinism: redox-drm wins virtio-gpu bind (priority-61 vendor 0x1AF4) so KWin gets a real card0 instead of virtio-gpud's VT scanout DONE a00c13e5
R Rust components compile-verified: redox-drm ✓, redbear-compositor ✓ (x86_64-redox) DONE
3 Full build campaign: mesa → libdrm → qt6 → kf6 → kwin → sddm; fix each compile failure TODO (needs cook)
4 Qt6 Wayland null+8: candidate patch wired (qtwaylandscanner-null-guard-listeners.patch) but NOT runtime-validated in isolation; root cause (why proxy NULL) open — see QT6-WAYLAND-NULL8-DIAGNOSIS.md §7 runbook TODO (runtime)
5 Boot redbear-full (QEMU virtio-gpu, -m 4G) → observe SDDM greeter on framebuffer TODO

Upstream cherry-pick candidates (enabling, not required yet)

From the upstream-forks sweep — fetch + cherry-pick only if we hit these runtime bugs (they touch operator-active kernel/relibc, so coordinate):

  • kernel eaf50894..486a7818: futex-on-shared-memory CoW fix (Mesa/Wayland shared buffers), poll-hang, read_with_timeout.
  • relibc 9867c155..707169e2: ld.so lazy PLT relocation (dlopen of libEGL/libgbm), poll/epoll timeout, UDS-connect outside rootfs.
  • base 59cf8189..488da6a1: ramfs hosting AF_UNIX sockets (Wayland $XDG_RUNTIME_DIR/wayland-0).

Runtime wiring audit (config/redbear-full.toml)

Greeter compositor: /etc/sddm.conf sets [Wayland] CompositorCommand=/usr/bin/redbear-compositor. So the SDDM greeter renders on redbear-compositor (KWin is the post-login session compositor). Rendering the greeter does NOT need the compositor input wiring (that only gates typing a login) — so "see the SDDM prompt" is reachable without the input refactor.

Runtime chain (coherent): 00_driver-manager sees the GPU PCI device → spawns redox-drm (priority-61 for virtio/Intel/AMD) → /scheme/drm/card021_sddm (REDBEAR_DRM_WAIT_SECONDS=30 waits for card0) → launches redbear-compositor → SDDM greeter Qt/Wayland UI. Needs dbus, seatd, redbear-sessiond, redbear-authd (all requires_weak on sddm).

CONFLICT — RESOLVED (9f528397, operator: "SDDM is the only greeter"): three display entry points fired as oneshot_async, each contending for the single-owner GPU/card0/VT: 20_display (redbear-session-launch KDE session), 20_greeter (redbear-greeterd), 21_sddm (target). The first two are now gated off reversibly via condition_path_exists = ["/etc/redbear/enable-legacy-greeter"] (sentinel not installed; touch it to re-enable). 21_sddm runs ungated. Post-login session launch is SDDM's job (SessionDir=/usr/share/wayland-sessions — note: no session .desktop is defined there yet; that's a post-prompt task).

Build notes / deficiencies fixed

  • Full builds re-cooked llvm21 (~1-2h) on every base/relibc bump — fixed in Phase 0.
  • Mesa source/ is an untracked build artifact; durable Mesa changes MUST be patches (Phase 1a).
  • More build-system deficiencies expected during the cook campaign — fix comprehensively as found.

Build campaign log

Round 1 (2026-07-24) — redox-driver-sys Once regression (sole blocker)

  • redbear-full --upstream launched. llvm21 precook OK (long pole done).
  • SOLE compile failure: redox-driver-sys fails for x86_64-redox with E0425 "cannot find type Once" (pci.rs:20) — a regression from operator commit d945483915 (added a Redox-only IOPL Once guard without importing it). It is a foundational dep (via linux-kpi) of mesa, redox-drm, and every driver, so it cascaded across the whole driver/graphics layer (mesa never reached EGL config).
  • Fixed: cfg-gated use std::sync::Once; (commit on redox-driver-sys source).
  • Desktop stack (Qt6/KF6/KWin/SDDM) does NOT depend on redox-driver-sys → caches fine in the doomed round. Plan: let round 1 cache the desktop stack, then restart incrementally with the fix so the driver/graphics layer cooks correctly.
  • Next: on restart, watch mesa (first real EGL-gate validation) + redox-drm.

Round 2 (2026-07-24) — mesa Redox port + full-ISO wiring

  • EGL gate validated: mesa configured (with_dri→egl/gbm) and compiled — the historical hard blocker is cleared. Two C-level Redox port gaps fixed, in order:
    1. alloca not declared (shader_query.cpp + others): force-include alloca.h via recipe meson c_args/cpp_args (relibc provides #define alloca __builtin_alloca).
    2. wayland-scanner exit 127: meson resolved the TARGET (Redox) wayland-scanner from wayland-scanner.pc (can't run on host); recipe now overwrites the sysroot copy with the host wayland-scanner before meson (protocol codegen is portable).
  • Full-ISO wiring fixed to reach SDDM (assessment + fixes):
    • VirGL: added priority-61 redox-drm 0x1AF4 entry to the INSTALLED inline 30-graphics.toml in config/redbear-full.toml (local/config/ copy was NOT shipped).
    • redbear-compositor: create_dir_all(XDG_RUNTIME_DIR) before Wayland socket bind.
    • redbear-iwlwifi excluded from redbear-meta deps (operator-authorized, temporary) so make live assembles.
    • SDDM-only greeter: 20_greeter/20_display gated off (earlier).
  • Next: mesa.pkgar → cook redox-drm/qt/kwin/sddm → assemble ISO (REDBEAR_SKIP_ABI_STALENESS=1 build-redbear.sh --upstream redbear-full) → boot QEMU virtio-gpu → SDDM prompt.

Round 3 (2026-07-24) — MESA BUILDS ON REDOX

mesa.pkgar produced (27MB); libEGL.so + libgbm.so staged. The historical hard blocker (Mesa EGL/DRI on Redox) is CLEARED. Five Redox port fixes total, all in the tracked recipe (durable):

  1. EGL gate: redox in meson system_has_kms_drm (patch 08).
  2. alloca: force-include alloca.h.
  3. wayland-scanner: overwrite sysroot copy with host binary (exit 127).
  4. CLOCK_MONOTONIC_RAW: relibc has none, and Redox CLOCK_MONOTONIC=4 (not Linux 1) — collided. Fixed by disabling Vulkan swrast (greeter uses GL, not Vulkan; Vulkan WSI was the only consumer) + collision-proof define. Next: full build assembles the ISO (mesa cached, + driver-manager [operator WIP]
  • redox-drm/qt/kwin/sddm) → boot QEMU virtio-gpu → SDDM prompt.

Round 4 (2026-07-24) — Qt 6.11.1 upgrade + durability correction

  • Durability correction: diffed committed qtbase source vs pristine 6.11.0 → BYTE-IDENTICAL (0 changed files). qtbase has NO in-place fixes; it simply never built before (no pkgar). Its Redox fixes are all in redox.patch (durable). The earlier "lost in-place fixes" alarm was a MISDIAGNOSIS — re-fetching 6.11.1 is safe. All session porting fixes go into durable patches in local/.
  • Qt version: recipes are tar=6.11.1 (operator intent); committed source was stale 6.11.0 (never re-fetched after the bump). Correct path = 6.11.1 for all modules + fixes as patches. Re-fetching 6.11.1 (safe, verified).
  • Durable patches so far: mesa (5 fixes, recipe+patch08), qtbase redox-in6-pktinfo.patch (recipe dir), qtsvg CVE patch reference fixed.
  • Next 6.11.1 gap: forkfd_wait4 conflicting types (a 6.11.1 header change vs 6.11.0; forkfd.c itself identical) — to fix as a durable patch.
  • Build-system deficiency noted: Qt source is committed in-tree (22k files/mod) yet re-fetch overwrites it — the durable truth should be recipe(tar+blake3)+patches, source gitignored. Flagged for operator (repo restructure).
  • ISO blocker (not mine): operator's driver-manager/redox-driver-sys WIP.