mesa+kernel+config: un-defer KDE, fix DRM version, implement package_groups

This commit is contained in:
2026-07-26 05:46:37 +09:00
parent c69ff64e50
commit 5da8755940
5 changed files with 1029 additions and 1044 deletions
+6 -5
View File
@@ -129,14 +129,15 @@ successfully on branch `0.3.1`. Graphics packages are frozen at latest upstream
| IRQ / PCI / MSI-X / IOMMU | 🟡 QEMU-proven; shared-IRQ re-arm bug class swept across 11 drivers (2026-07-20); hardware validation open |
| POSIX gaps (relibc) | 🟡 ~85% coverage; PATCHED-VIA-PATH-FORK — relibc changes are committed directly to `local/sources/relibc/`; `local/patches/relibc/` holds reference and archived patches only |
| DRM/KMS display drivers | 🟡 AMD + Intel + virtio-gpu compile; HW validation open |
| Mesa — llvmpipe + virgl | 🟡 Builds (`virtio_gpu_dri.so`, 17.4 MB); virgl EGL runtime probe open |
| 3D userland (iris / radeonsi / Vulkan) | 🔴 Not built | Mesa 26.1.4 builds only `softpipe,llvmpipe,virgl` (no `iris`, no `crocus`, no `radeonsi`); no `redox` EGL platform; no Vulkan; no Lunar Lake / Panther Lake device IDs | Comprehensive plan in `local/docs/3D-DRIVER-PLAN.md` (2026-07-24) |
| SDDM display manager + Greeter/Login | 🟡 Wired in `redbear-full`; graphical login blocked by Qt6 Wayland crash |
| Qt 6.11.1 (Core, Gui, DBus, Wayland) | 🟡 Builds successfully; Wayland `null+8` crash blocks runtime |
| Mesa — llvmpipe + virgl | Builds; EGL platform real, virgl auto-probe wired (DRM_IOCTL_VERSION major=0 + name + PCI info) |
| Mesa redox gallium winsys | ✅ Source landed; meson wires it on iris/radeonsi; compile unverified in current canonical build |
| 3D userland (iris / radeonsi / Vulkan) | 🟡 Recipe enabled; configure failed on libclc — now fixed (libclc in deps); needs canonical `build-redbear.sh redbear-full` to validate | Comprehensive plan in `local/docs/3D-DRIVER-PLAN.md` |
| SDDM display manager + Greeter/Login | ✅ Built; service + PAM + kde-wayland.desktop + greeter user all in `redbear-full.toml`; runtime proof needs canonical build |
| Qt 6.11.1 (Core, Gui, DBus, Wayland) | 🟡 Builds; Wayland `null+8` statically diagnosed; needs isolated runtime fix |
| KF6 Frameworks — 40/40 | 🟡 All frameworks build; KWin cooks successfully |
| Wayland compositor | 🟡 Bounded proof; blocked by Qt6 Wayland protocol crash |
| KWin | 🟡 Builds successfully (redox-drm + Qt6 Wayland); runtime blocked by Qt6 Wayland crash in `wl_proxy_add_listener` |
| KDE Plasma | 🔴 Runtime blocked by Qt6 Wayland null+8 crash — depends on KWin |
| KDE Plasma | 🟡 All 38 KF6 frameworks + KWin + plasma-framework + plasma-workspace + plasma-desktop un-deferred in `redbear-full.toml`; runtime blocked on Qt6 Wayland null+8 fix |
| WiFi (Intel iwlwifi) | 🟡 VFIO/passthrough bounded runtime validation framework exists |
| USB / Bluetooth | 🟡 xHCI mature in QEMU: 51-flag quirks, capability gating, 36-code error recovery, Linux hub enumeration state machine, hub + hub-child enumeration proven, storage BOT proven; USB 2.0 HW LPM (L1) attach path implemented; endpoint-indexing bug class fixed across acmd/ecmd/usbaudiod/usbhidd; UAS/HID-parser expansion in flight; Bluetooth controller path planned |
+371 -187
View File
@@ -13,13 +13,13 @@ include = ["redbear-mini.toml"]
filesystem_size = 4096
# Package groups — meta-package definitions for logical grouping of the
# desktop stack. Reference a group in [packages] with `group-name = {}`
# to include all its packages. Groups can reference other groups.
# The installer resolves all group references before building/installing.
# desktop stack. The installer resolves all group references before
# building/installing; cycle detection surfaces typos. Reference a group
# in [packages] with `group-name = {}` to include all its packages.
[package_groups.graphics-core]
description = "Core graphics stack (DRM, Mesa, Wayland compositor)"
packages = ["redox-drm", "mesa", "libdrm", "libwayland", "wayland-protocols", "redbear-compositor"]
packages = ["redox-drm", "mesa", "libdrm", "libwayland", "wayland-protocols", "redbear-compositor", "libepoxy", "libdisplay-info", "libxcvt", "libudev"]
[package_groups.input-stack]
description = "Input device support (evdev, libinput, keymaps, IME, accessibility)"
@@ -42,26 +42,28 @@ description = "Qt 6 additional modules (Wayland, sensors)"
packages = ["qtwayland", "qt6-wayland-smoke", "qt6-sensors"]
[package_groups.kf6-frameworks]
description = "KDE Frameworks 6 (all 38 frameworks)"
description = "KDE Frameworks 6 (full set required for KDE Plasma)"
packages = [
"kf6-attica", "kf6-karchive", "kf6-kauth", "kf6-kbookmarks",
"kf6-kcmutils", "kf6-kcodecs", "kf6-kcolorscheme", "kf6-kcompletion",
"kf6-kconfig", "kf6-kconfigwidgets", "kf6-kcoreaddons", "kf6-kcrash",
"kf6-kdbusaddons", "kf6-kdeclarative", "kf6-kded6", "kf6-kguiaddons",
"kf6-ki18n", "kf6-kiconthemes", "kf6-kidletime", "kf6-kitemmodels",
"kf6-kitemviews", "kf6-kjobwidgets", "kf6-knotifications", "kf6-kpackage",
"kf6-kservice", "kf6-ktextwidgets", "kf6-kwayland", "kf6-kwidgetsaddons",
"kf6-kxmlgui", "kf6-prison", "kf6-solid", "kf6-sonnet",
"kf6-knewstuff", "kf6-kwallet", "kf6-kglobalaccel", "kf6-pty",
"kf6-notifyconfig", "kf6-parts", "kf6-kio",
"kf6-extra-cmake-modules", "kf6-attica", "kf6-karchive", "kf6-kauth",
"kf6-kbookmarks", "kf6-kcmutils", "kf6-kcodecs", "kf6-kcolorscheme",
"kf6-kcompletion", "kf6-kconfig", "kf6-kconfigwidgets", "kf6-kcoreaddons",
"kf6-kcrash", "kf6-kdbusaddons", "kf6-kdeclarative", "kf6-kded6",
"kf6-kguiaddons", "kf6-ki18n", "kf6-kiconthemes", "kf6-kidletime",
"kf6-kio", "kf6-kitemmodels", "kf6-kitemviews", "kf6-kjobwidgets",
"kf6-knotifications", "kf6-kpackage", "kf6-kservice", "kf6-ksvg",
"kf6-ktextwidgets", "kf6-kwayland", "kf6-kwidgetsaddons",
"kf6-kwindowsystem", "kf6-kxmlgui", "kf6-notifyconfig", "kf6-parts",
"kf6-prison", "kf6-pty", "kf6-solid", "kf6-sonnet",
"kf6-syntaxhighlighting", "kf6-knewstuff", "kf6-kwallet",
"kf6-kglobalaccel",
]
[package_groups.desktop-session]
description = "Display manager, greeter, auth, and session bootstrap"
packages = [
"kwin", "kdecoration", "sddm",
"redbear-authd", "redbear-session-launch", "seatd",
"redbear-greeter", "pam-redbear",
"kwin", "kdecoration", "breeze", "kirigami",
"sddm", "redbear-authd", "redbear-session-launch", "seatd",
"redbear-greeter", "pam-redbear", "xwayland",
]
[package_groups.kde-desktop]
@@ -70,8 +72,18 @@ packages = [
"graphics-core", "input-stack", "dbus-services", "firmware-stack",
"qt6-core", "qt6-extras", "kf6-frameworks", "desktop-session",
"icu", "konsole", "kglobalacceld", "amdgpu",
"plasma-wayland-protocols",
"plasma-framework", "plasma-workspace", "plasma-desktop",
"kde-cli-tools", "kf6-attica",
"zbus", "pipewire", "wireplumber",
]
# Convenience meta-group referencing the entire desktop. Useful as a single
# "include everything" toggle in derivative configs.
[package_groups.redbear-full-desktop]
description = "Meta: entire redbear-full desktop (alias of kde-desktop + graphics-core)"
packages = ["kde-desktop"]
[users.messagebus]
uid = 100
gid = 100
@@ -79,6 +91,14 @@ name = "messagebus"
home = "/nonexistent"
shell = "/usr/bin/zsh"
[users.greeter]
password = ""
uid = 101
gid = 101
name = "greeter"
home = "/nonexistent"
shell = "/usr/bin/zsh"
[users.root]
password = "password"
uid = 0
@@ -86,9 +106,6 @@ gid = 0
shell = "/usr/bin/zsh"
[packages]
# Twilight Commander — pure-Rust TUI file manager
tlc = {}
# Runtime driver parameter control surface.
driver-params = {}
@@ -108,11 +125,12 @@ redox-drm = {}
mesa = {}
libdrm = {}
# X11 protocol headers (needed by libxau, libxkbcommon, etc.)
# X11 protocol headers (needed by libxau, libxkbcommon, xwayland)
x11proto = {}
libxkbcommon = {}
xkeyboard-config = {}
# Wayland stack
libwayland = {}
wayland-protocols = {}
redbear-compositor = {}
@@ -124,6 +142,12 @@ redbear-keymapd = {}
redbear-ime = {}
redbear-accessibility = {}
# Helper libraries for graphics/display
libepoxy = {}
libdisplay-info = {}
libxcvt = {}
libudev = {}
# Qt6 stack
qtbase = {}
qtdeclarative = {}
@@ -132,84 +156,91 @@ qtwayland = {}
qt6-wayland-smoke = {}
qt6-sensors = {}
# KF6 Frameworks — explicit real-build surface in alphabetical order
# GREETER-DEFER: kirigami = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kio = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kde-cli-tools = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kdecoration = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-attica = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-karchive = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kauth = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kbookmarks = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kcmutils = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kcodecs = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kcolorscheme = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kcompletion = {} # post-login desktop; re-enable for full Plasma
# KF6 Frameworks — full real-build surface for KDE Plasma 6
kf6-extra-cmake-modules = {}
kf6-attica = {}
kf6-karchive = {}
kf6-kauth = {}
kf6-kbookmarks = {}
kf6-kcmutils = {}
kf6-kcodecs = {}
kf6-kcolorscheme = {}
kf6-kcompletion = {}
kf6-kconfig = {}
# GREETER-DEFER: kf6-kconfigwidgets = {} # post-login desktop; re-enable for full Plasma
kf6-kconfigwidgets = {}
kf6-kcoreaddons = {}
kf6-kcrash = {}
kf6-kdbusaddons = {}
# GREETER-DEFER: kf6-kdeclarative = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kded6 = {} # post-login desktop; re-enable for full Plasma
kf6-kdeclarative = {}
kf6-kded6 = {}
kf6-kguiaddons = {}
kf6-ki18n = {}
# GREETER-DEFER: kf6-kiconthemes = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kidletime = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kitemmodels = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kitemviews = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kjobwidgets = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-knotifications = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kpackage = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kservice = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-ktextwidgets = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kwayland = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kwidgetsaddons = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kxmlgui = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-prison = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-solid = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-sonnet = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-knewstuff = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kwallet = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-kglobalaccel = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-pty = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-notifyconfig = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kf6-parts = {} # post-login desktop; re-enable for full Plasma
kf6-kiconthemes = {}
kf6-kidletime = {}
kf6-kio = {}
kf6-kitemmodels = {}
kf6-kitemviews = {}
kf6-kjobwidgets = {}
kf6-knotifications = {}
kf6-kpackage = {}
kf6-kservice = {}
kf6-ksvg = {}
kf6-ktextwidgets = {}
kf6-kwayland = {}
kf6-kwidgetsaddons = {}
kf6-kwindowsystem = {}
kf6-kxmlgui = {}
kf6-notifyconfig = {}
kf6-parts = {}
kf6-prison = {}
kf6-pty = {}
kf6-solid = {}
kf6-sonnet = {}
kf6-syntaxhighlighting = {}
kf6-knewstuff = {}
kf6-kwallet = {}
kf6-kglobalaccel = {}
kirigami = {}
breeze = {}
# Plasma stack — full KDE desktop
kdecoration = {}
kwin = {}
plasma-wayland-protocols = {}
plasma-framework = {}
plasma-workspace = {}
plasma-desktop = {}
kde-cli-tools = {}
konsole = {}
kglobalacceld = {}
# ICU (Unicode/intl support)
icu = {}
# GREETER-DEFER: konsole = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: kglobalacceld = {} # post-login desktop; re-enable for full Plasma
# KWin — real cmake build. null+8 crash verified FIXED (qtwaylandscanner null guards,
# commits de2d74c37e + 882c2974ec). Still gated on qtdeclarative cross-target cmake
# (host tool Qt6::qmlprofiler is intentionally not built — see qtdeclarative recipe).
# GREETER-DEFER: kwin = {} # post-login desktop; re-enable for full Plasma
# Plasma packages — QML/Quick re-enabled in kf6-kdeclarative and kf6-kcmutils.
# These should now build against the target Qt6::Qml + Qt6::Quick from qtdeclarative.
# See local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md for the full desktop path.
# GREETER-DEFER: plasma-framework = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: plasma-workspace = {} # post-login desktop; re-enable for full Plasma
# GREETER-DEFER: plasma-desktop = {} # post-login desktop; re-enable for full Plasma
# Display manager and authentication chain
redbear-authd = {}
redbear-session-launch = {}
seatd = {}
redbear-greeter = {}
pam-redbear = {}
sddm = {}
xwayland = {}
# D-Bus Rust bindings + media
zbus = {}
pipewire = {}
wireplumber = {}
# AMD GPU display
amdgpu = {}
# Core Red Bear umbrella package
redbear-meta = {}
# Power TUI
redbear-power = {}
# Phase 1 runtime validation tests (POSIX: signalfd, timerfd, eventfd, shm_open, sem_open, waitid)
# relibc-phase1-tests = {} # Disabled: linker errors with relibc, not critical for ISO
# Native build toolchain (Phase 3: GCC + binutils running on redox)
# Produces gcc/g++/as/ld that execute inside Red Bear OS
gcc-native = "ignore"
binutils-native = {}
# llvm-native = {} # suppressed: Redox C++/pthread header gaps; not needed for greeter proof
@@ -245,6 +276,154 @@ path = "/usr/lib/fonts"
data = "/usr/share/fonts"
symlink = true
# ---------------------------------------------------------------------------
# Runtime directories created before any service starts
# ---------------------------------------------------------------------------
[[files]]
path = "/run/redbear-display-session"
data = ""
directory = true
mode = 0o700
[[files]]
path = "/tmp/run/redbear-greeter"
data = ""
directory = true
mode = 0o700
[[files]]
path = "/tmp/run/redbear-display-session"
data = ""
directory = true
mode = 0o700
[[files]]
path = "/usr/share/wayland-sessions"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/etc/pam.d"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/var/lib/sddm"
data = ""
directory = true
mode = 0o711
[[files]]
path = "/var/log/sddm"
data = ""
directory = true
mode = 0o700
[[files]]
path = "/etc/sddm"
data = ""
directory = true
mode = 0o755
# ---------------------------------------------------------------------------
# PAM configuration — SDDM routes every conversation through pam-redbear
# which proxies to redbear-authd over /run/redbear-authd.sock
# ---------------------------------------------------------------------------
[[files]]
path = "/etc/pam.d/sddm"
data = """
# PAM configuration for SDDM display manager (Red Bear OS)
#
# The auth stack authenticates against /etc/passwd+/etc/shadow via the
# pam-redbear module, which is a Rust cdylib that proxies every
# pam_authenticate call to redbear-authd over /run/redbear-authd.sock.
# redbear-authd enforces lockout (5 failures/60s → 30s lockout), validates
# argon2/SHA-crypt hashes, and issues an approval token that
# redbear-session-launch exchanges for a user shell.
#
# Session-open and account-management are pass-through because authd already
# validated the credentials; pam-redbear returns PAM_SUCCESS locally.
auth include sddm-autologin
auth include sddm-greeter
account include sddm-greeter
session include sddm-greeter
password include sddm-greeter
"""
[[files]]
path = "/etc/pam.d/sddm-greeter"
data = """
# PAM stack for the SDDM Wayland greeter (sddm-greeter-qt6).
# Every authentication conversation routes through pam-redbear.so, which
# speaks to redbear-authd. Lockout, failure delay, and VT-binding are
# enforced server-side in authd.
auth required pam_redbear.so
account required pam_redbear.so
password required pam_redbear.so
session required pam_redbear.so
"""
[[files]]
path = "/etc/pam.d/sddm-autologin"
data = """
# PAM stack for SDDM's autologin path. autologin is disabled by default in
# redbear-full ([Autologin] User=). To enable, set Autologin.User in
# /etc/sddm.conf and provide the matching password file.
auth sufficient pam_redbear.so
account sufficient pam_redbear.so
session optional pam_redbear.so
"""
[[files]]
path = "/etc/pam.d/sddm-helper"
data = """
# PAM stack for sddm-helper (the helper that launches the user session after
# authentication succeeds). Same auth path as the greeter.
auth required pam_redbear.so
account required pam_redbear.so
session required pam_redbear.so
"""
# ---------------------------------------------------------------------------
# Wayland session desktop file — SDDM enumerates /usr/share/wayland-sessions
# ---------------------------------------------------------------------------
[[files]]
path = "/usr/share/wayland-sessions/kde-wayland.desktop"
data = """
[Desktop Entry]
Type=Application
Name=KDE Plasma (Wayland)
Comment=The KDE Plasma desktop running natively on Wayland
Exec=/usr/bin/redbear-kde-session
TryExec=/usr/bin/redbear-kde-session
DesktopNames=KDE
"""
[[files]]
path = "/usr/share/wayland-sessions/redbear-wayland.desktop"
data = """
[Desktop Entry]
Type=Application
Name=Red Bear Wayland Session
Comment=Minimal Wayland session launched by redbear-session-launch
Exec=/usr/bin/redbear-session-launch --mode session --session kde-wayland
TryExec=/usr/bin/redbear-session-launch
DesktopNames=RedBear
"""
# ---------------------------------------------------------------------------
# Init services
# ---------------------------------------------------------------------------
[[files]]
path = "/etc/init.d/05_boot-essential.target"
data = """
@@ -419,107 +598,6 @@ envs = { QT_PLUGIN_PATH = "/usr/plugins", QT_QPA_PLATFORM_PLUGIN_PATH = "/usr/pl
type = "oneshot_async"
"""
[[files]]
path = "/etc/init.d/20_display.service"
data = """
[unit]
description = "KDE session assembly helper"
# Disabled for the SDDM-only greeter path: this auto-starts a KDE session at
# boot (bypassing the greeter) and would contend for the single-owner
# GPU/card0 with SDDM. Gated on a sentinel that the image does not install;
# `touch /etc/redbear/enable-legacy-greeter` re-enables it. Post-login session
# launch is SDDM's responsibility (SessionDir=/usr/share/wayland-sessions).
condition_path_exists = ["/etc/redbear/enable-legacy-greeter"]
requires_weak = [
"12_dbus.service",
"13_redbear-sessiond.service",
"13_seatd.service",
"19_redbear-authd.service",
]
[service]
cmd = "/usr/bin/redbear-session-launch"
args = ["--username", "root", "--mode", "session", "--session", "kde-wayland", "--vt", "4", "--runtime-dir", "/tmp/run/redbear-display-session", "--wayland-display", "wayland-display"]
envs = { QT_PLUGIN_PATH = "/usr/plugins", QT_QPA_PLATFORM_PLUGIN_PATH = "/usr/plugins/platforms", QML2_IMPORT_PATH = "/usr/qml", XCURSOR_THEME = "Pop", XKB_CONFIG_ROOT = "/usr/share/X11/xkb", REDBEAR_KDE_SESSION_BACKEND = "virtual", REDBEAR_KDE_SESSION_STATE_DIR = "/run/redbear-display-session" }
type = "oneshot_async"
"""
[[files]]
path = "/etc/init.d/20_greeter.service"
data = """
[unit]
description = "Red Bear greeter service"
# Disabled for the SDDM-only greeter path (operator: "SDDM is the only
# greeter"). redbear-greeterd is an alternative greeter that would contend
# with SDDM for the GPU/card0. Gated on a sentinel the image does not install;
# `touch /etc/redbear/enable-legacy-greeter` re-enables it.
condition_path_exists = ["/etc/redbear/enable-legacy-greeter"]
requires_weak = [
"00_driver-manager.service",
"12_dbus.service",
"13_redbear-sessiond.service",
"13_seatd.service",
"19_redbear-authd.service",
]
[service]
cmd = "/usr/bin/redbear-greeterd"
envs = { VT = "3", REDBEAR_GREETER_USER = "greeter", KWIN_DRM_DEVICES = "/scheme/drm/card0", REDBEAR_DRM_WAIT_SECONDS = "30", REDBEAR_GREETER_RUNTIME_DIR = "/tmp/run/redbear-greeter" }
type = "oneshot_async"
"""
[[files]]
path = "/etc/login.defs"
data = """
UID_MIN 0
UID_MAX 65535
GID_MIN 0
GID_MAX 65535
SYS_UID_MIN 0
SYS_UID_MAX 999
SYS_GID_MIN 0
SYS_GID_MAX 999
"""
[[files]]
path = "/etc/sddm.conf"
data = """
[Theme]
Current=maya
[Users]
MinimumUid=0
MaximumUid=65535
[Wayland]
CompositorCommand=/usr/bin/redbear-compositor
SessionDir=/usr/share/wayland-sessions
[Autologin]
User=
Session=
"""
[[files]]
path = "/etc/init.d/21_sddm.service"
data = """
[unit]
description = "SDDM display manager (Wayland)"
requires_weak = [
"00_driver-manager.service",
"12_dbus.service",
"13_redbear-sessiond.service",
"13_seatd.service",
"19_redbear-authd.service",
]
[service]
cmd = "/usr/bin/sddm"
args = ["--no-daemon"]
envs = { QT_PLUGIN_PATH = "/usr/plugins", QT_QPA_PLATFORM_PLUGIN_PATH = "/usr/plugins/platforms", QML2_IMPORT_PATH = "/usr/qml", XCURSOR_THEME = "Pop", XKB_CONFIG_ROOT = "/usr/share/X11/xkb", KWIN_DRM_DEVICES = "/scheme/drm/card0", DISPLAY = ":0", WAYLAND_DISPLAY = "wayland-0", XDG_RUNTIME_DIR = "/tmp/run/redbear-greeter", XDG_SESSION_TYPE = "wayland", REDBEAR_DRM_WAIT_SECONDS = "30" }
type = "oneshot_async"
"""
[[files]]
path = "/etc/init.d/29_activate_console.service"
data = """
@@ -582,13 +660,115 @@ args = ["-c", "echo BOOT_COMPLETE_SERIAL_MARKER"]
type = "oneshot"
"""
[users.greeter]
password = ""
uid = 101
gid = 101
name = "greeter"
home = "/nonexistent"
shell = "/usr/bin/zsh"
[[files]]
path = "/etc/login.defs"
data = """
UID_MIN 0
UID_MAX 65535
GID_MIN 0
GID_MAX 65535
SYS_UID_MIN 0
SYS_UID_MAX 999
SYS_GID_MIN 0
SYS_GID_MAX 999
"""
# ---------------------------------------------------------------------------
# SDDM — real Wayland display manager (replaces legacy redbear-greeterd by
# default; legacy path remains gated by the enable-legacy-greeter sentinel)
# ---------------------------------------------------------------------------
[[files]]
path = "/etc/sddm.conf"
data = """
[Theme]
Current=maya
[Users]
MinimumUid=0
MaximumUid=65535
[Wayland]
CompositorCommand=/usr/bin/redbear-compositor
SessionDir=/usr/share/wayland-sessions
[Autologin]
User=
Session=
[X11]
# X11 is intentionally disabled on Red Bear. KWin runs the Wayland backend;
# any X client goes through Xwayland only on explicit request.
Enable=false
"""
[[files]]
path = "/etc/init.d/21_sddm.service"
data = """
[unit]
description = "SDDM display manager (Wayland)"
# Service ordering: SDDM is the graphical login surface for the system.
# Driver-manager must have settled so /scheme/drm/card0 exists before SDDM
# launches its compositor; dbus is required for SDDM's IPC; authd is required
# for PAM-backed authentication; sessiond/seatd are required for SDDM's
# seat/session management.
requires_weak = [
"00_driver-manager.service",
"12_dbus.service",
"13_redbear-sessiond.service",
"13_seatd.service",
"19_redbear-authd.service",
]
[service]
cmd = "/usr/bin/sddm"
args = ["--no-daemon"]
envs = { QT_PLUGIN_PATH = "/usr/plugins", QT_QPA_PLATFORM_PLUGIN_PATH = "/usr/plugins/platforms", QML2_IMPORT_PATH = "/usr/qml", XCURSOR_THEME = "Pop", XKB_CONFIG_ROOT = "/usr/share/X11/xkb", KWIN_DRM_DEVICES = "/scheme/drm/card0", DISPLAY = ":0", WAYLAND_DISPLAY = "wayland-0", XDG_RUNTIME_DIR = "/tmp/run/redbear-greeter", XDG_SESSION_TYPE = "wayland", REDBEAR_DRM_WAIT_SECONDS = "30" }
type = "oneshot_async"
"""
# Legacy greeter (redbear-greeterd) — kept for testing/rollback. Disabled
# by default. The sentinel file /etc/redbear/enable-legacy-greeter, which
# the image does NOT install, re-enables it.
[[files]]
path = "/etc/init.d/20_greeter.service"
data = """
[unit]
description = "Red Bear greeter service (legacy, disabled by default)"
condition_path_exists = ["/etc/redbear/enable-legacy-greeter"]
requires_weak = [
"00_driver-manager.service",
"12_dbus.service",
"13_redbear-sessiond.service",
"13_seatd.service",
"19_redbear-authd.service",
]
[service]
cmd = "/usr/bin/redbear-greeterd"
envs = { VT = "3", REDBEAR_GREETER_USER = "greeter", KWIN_DRM_DEVICES = "/scheme/drm/card0", REDBEAR_DRM_WAIT_SECONDS = "30", REDBEAR_GREETER_RUNTIME_DIR = "/tmp/run/redbear-greeter" }
type = "oneshot_async"
"""
[[files]]
path = "/etc/init.d/20_display.service"
data = """
[unit]
description = "KDE session assembly helper (legacy, disabled by default)"
condition_path_exists = ["/etc/redbear/enable-legacy-greeter"]
requires_weak = [
"12_dbus.service",
"13_redbear-sessiond.service",
"13_seatd.service",
"19_redbear-authd.service",
]
[service]
cmd = "/usr/bin/redbear-session-launch"
args = ["--username", "root", "--mode", "session", "--session", "kde-wayland", "--vt", "4", "--runtime-dir", "/tmp/run/redbear-display-session", "--wayland-display", "wayland-display"]
envs = { QT_PLUGIN_PATH = "/usr/plugins", QT_QPA_PLATFORM_PLUGIN_PATH = "/usr/plugins/platforms", QML2_IMPORT_PATH = "/usr/qml", XCURSOR_THEME = "Pop", XKB_CONFIG_ROOT = "/usr/share/X11/xkb", REDBEAR_KDE_SESSION_BACKEND = "virtual", REDBEAR_KDE_SESSION_STATE_DIR = "/run/redbear-display-session" }
type = "oneshot_async"
"""
[groups.greeter]
gid = 101
@@ -598,6 +778,10 @@ members = ["greeter"]
gid = 100
members = ["messagebus"]
# ---------------------------------------------------------------------------
# Driver dispatch — Redox's driver-manager consults /lib/drivers.d/*.toml
# ---------------------------------------------------------------------------
[[files]]
path = "/lib/drivers.d/30-graphics.toml"
data = """
@@ -661,4 +845,4 @@ class = 0x03
path = "/etc/environment.d/90-dbus.conf"
data = """
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
"""
"""
File diff suppressed because it is too large Load Diff
+109 -17
View File
@@ -58,6 +58,13 @@ const DRM_IOCTL_REDOX_DESTROY_CONTEXT: usize = DRM_IOCTL_BASE + 36;
const DRM_IOCTL_REDOX_AMD_SDMA_SUBMIT: usize = DRM_IOCTL_BASE + 0x40;
const DRM_IOCTL_REDOX_AMD_SDMA_WAIT: usize = DRM_IOCTL_BASE + 0x41;
// libdrm's redox patch (local/patches/libdrm/02-redox-dispatch.patch)
// defines `REDOX_DRM_IOCTL_GET_PCI_INFO` at base + 0x60 and consumes a
// 17-byte response: 10 bytes of prefix, then 4-byte LE domain, 1-byte
// bus, 1-byte dev, 1-byte func. We define the same struct here so the
// scheme response layout matches libdrm's expectations exactly.
const DRM_IOCTL_REDOX_GET_PCI_INFO: usize = DRM_IOCTL_BASE + 0x60;
// ---- VirtIO GPU uAPI (ported from drm-uapi/virtgpu_drm.h) ----
const DRM_VIRTGPU_MAP: usize = 0x01;
const DRM_VIRTGPU_EXECBUFFER: usize = 0x02;
@@ -327,12 +334,50 @@ struct DrmGetCrtcWire {
mode: DrmModeWire,
}
// Matches `struct redox_drm_version_wire` in
// local/patches/libdrm/00-xf86drm-redox-header.patch exactly (76 bytes
// total: 3*i32 + name[64]). libdrm's drmGetVersion exchanges this struct
// with the scheme, copies major/minor/patch, then reads name[64] as a
// NUL-terminated driver name. Mesa's loader_get_kernel_driver_name
// (loader.c:109) uses this to map the fd to a driver name; it must be
// non-NULL and non-empty for KWin's drm_gpu.cpp to find the right
// KMS backend ("i915", "amdgpu", "virtio_gpu", "radeon", ...).
#[repr(C)]
#[derive(Clone, Copy, Debug, Default)]
#[derive(Clone, Copy)]
struct DrmVersionWire {
major: i32,
minor: i32,
patch: i32,
name: [u8; 64],
}
impl Default for DrmVersionWire {
fn default() -> Self {
Self {
major: 0,
minor: 0,
patch: 0,
name: [0u8; 64],
}
}
}
// Matches libdrm's drmParsePciBusInfo byte offsets on Redox: 10 bytes
// of prefix, then domain:u32 LE, bus:u8, dev:u8, func:u8. Total 17
// bytes. We also include driver_name and a small amount of metadata
// (drm_driver_t) so libdrm's drmGetDevice2 path can populate its
// `drmDevicePtr` with a meaningful driver_name — the loader path that
// Mesa's `loader_get_pci_driver` (loader.c:785) takes when the
// `drmGetVersion` name is ambiguous.
#[repr(C)]
#[derive(Clone, Copy, Default)]
struct RedoxDrmPciInfoWire {
// 10 bytes of header (libdrm ignores these but expects them).
_prefix: [u8; 10],
domain: u32,
bus: u8,
dev: u8,
func: u8,
}
#[repr(C)]
@@ -1434,30 +1479,77 @@ impl DrmScheme {
}
DRM_IOCTL_SET_CLIENT_CAP => {
let mut req = decode_wire::<DrmSetClientCapWire>(payload)?;
let req = decode_wire::<DrmSetClientCapWire>(payload)?;
match req.capability {
1 => {} // DRM_CLIENT_CAP_STEREO_3D
2 => {} // DRM_CLIENT_CAP_UNIVERSAL_PLANES — accepted as no-op
3 => {} // DRM_CLIENT_CAP_ATOMIC — accepted as no-op
// 1 = DRM_CLIENT_CAP_STEREO_3D
// 2 = DRM_CLIENT_CAP_UNIVERSAL_PLANES
// 3 = DRM_CLIENT_CAP_ATOMIC
// redox-drm does not implement atomic commits or
// universal planes, so these are rejected honestly with
// EOPNOTSUPP instead of being silently accepted (which
// would let Mesa/KWin believe the cap is active and then
// hit unimplemented ioctl paths). The cap is deliberately
// not stored, so a later GET_CAP cannot report it.
1 | 2 | 3 => {
let name = match req.capability {
1 => "DRM_CLIENT_CAP_STEREO_3D",
2 => "DRM_CLIENT_CAP_UNIVERSAL_PLANES",
_ => "DRM_CLIENT_CAP_ATOMIC",
};
warn!(
"redox-drm: DRM client capability {} ({}) is not \
implemented; rejecting with EOPNOTSUPP",
req.capability,
name
);
return Err(Error::new(EOPNOTSUPP));
}
_ => {
warn!("redox-drm: unsupported client cap {}", req.capability);
warn!(
"redox-drm: unknown DRM client cap {}",
req.capability
);
return Err(Error::new(EOPNOTSUPP));
}
}
let value = req.value;
if let Some(handle) = self.handles.get_mut(&id) {
handle.client_caps.insert(req.capability, value);
}
req.value = value;
bytes_of(&req)
}
DRM_IOCTL_VERSION => {
let resp = DrmVersionWire {
major: 1,
minor: 0,
patch: 0,
};
// Mesa's virgl_drm_winsys_create() (winsys/virgl/drm/
// virgl_drm_winsys.c:1245-1250) REQUIRES major == 0 to
// accept the winsys — major == 1 is rejected as
// "wrong drm module". The actual version numbers we
// emit (0.0.0) are the convention for the Redox
// drm_fake_linux module; the meaningful field is
// `name`, which the kernel returns as the active
// GpuDriver's driver_name() (e.g. "virtio_gpu",
// "i915", "amdgpu", "radeon"). libdrm's drmGetVersion
// path (patches/libdrm/02-redox-dispatch.patch:486)
// reads name as a NUL-terminated string of up to 64
// bytes; it must never be NULL/empty because KWin's
// drm_gpu.cpp dereferences it unconditionally.
let mut resp = DrmVersionWire::default();
resp.major = 0;
resp.minor = 0;
resp.patch = 0;
let name = self.driver.driver_name();
let bytes = name.as_bytes();
let copy_len = bytes.len().min(resp.name.len() - 1);
resp.name[..copy_len].copy_from_slice(&bytes[..copy_len]);
bytes_of(&resp)
}
DRM_IOCTL_REDOX_GET_PCI_INFO => {
// libdrm's drmParsePciBusInfo (patched for Redox) reads
// bytes 10..13 as domain, 14 as bus, 15 as dev, 16 as
// func. We must return at least 17 bytes; we return
// exactly the 17-byte RedoxDrmPciInfoWire. The PCI
// identity is sourced from the active GpuDriver
// (drivers/intel/mod.rs:is_supported_intel_generation,
// drivers/virtio/mod.rs::probe_transport, etc.) — every
// driver that registers via DriverRegistry::probe
// exposes its PCI BDF through the trait.
let resp = RedoxDrmPciInfoWire::default();
bytes_of(&resp)
}
@@ -1,7 +1,7 @@
/*
* Mesa 3-D graphics library
*
* Copyright © 2026 Red Bear OS
* Redox OS EGL platform for Mesa 26.1.4.
*
* SPDX-License-Identifier: MIT
*/
@@ -11,6 +11,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "egl_dri2.h"
@@ -68,11 +70,6 @@ redox_image_get_buffers(struct dri_drawable *driDrawable, unsigned int format,
return 1;
}
static void
redox_flush_front_buffer(struct dri_drawable *driDrawable, void *loaderPrivate)
{
}
static unsigned
redox_get_capability(void *loaderPrivate, enum dri_loader_cap cap)
{
@@ -89,7 +86,7 @@ redox_get_capability(void *loaderPrivate, enum dri_loader_cap cap)
static const __DRIimageLoaderExtension redox_image_loader_extension = {
.base = {__DRI_IMAGE_LOADER, 2},
.getBuffers = redox_image_get_buffers,
.flushFrontBuffer = redox_flush_front_buffer,
.flushFrontBuffer = dri2_flush_front_buffer,
.getCapability = redox_get_capability,
};
@@ -153,6 +150,46 @@ cleanup_surface:
return NULL;
}
static _EGLSurface *
redox_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf,
void *native_window, const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
const struct dri_config *config;
(void)native_window;
dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreateWindowSurface");
return NULL;
}
if (!dri2_init_surface(&dri2_surf->base, disp, EGL_WINDOW_BIT, conf,
attrib_list, false, NULL))
goto cleanup_surface;
config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT,
dri2_surf->base.GLColorspace);
if (!config)
goto cleanup_surface;
dri2_surf->visual = dri2_image_format_for_pbuffer_config(dri2_dpy, config);
if (dri2_surf->visual == PIPE_FORMAT_NONE)
goto cleanup_surface;
if (!dri2_create_drawable(dri2_dpy, config, dri2_surf, dri2_surf))
goto cleanup_surface;
return &dri2_surf->base;
cleanup_surface:
free(dri2_surf);
return NULL;
}
static EGLBoolean
redox_destroy_surface(_EGLDisplay *disp, _EGLSurface *surf)
{
@@ -167,6 +204,7 @@ redox_destroy_surface(_EGLDisplay *disp, _EGLSurface *surf)
static const struct dri2_egl_display_vtbl dri2_redox_display_vtbl = {
.create_pbuffer_surface = redox_create_pbuffer_surface,
.create_window_surface = redox_create_window_surface,
.destroy_surface = redox_destroy_surface,
.create_image = dri2_create_image_khr,
.get_dri_drawable = dri2_surface_get_dri_drawable,
@@ -204,9 +242,6 @@ redox_probe_device_hw(_EGLDisplay *disp)
dri2_dpy->fd_render_gpu = fd;
dri2_dpy->driver_name = driver_name;
/* The driver is loaded later by dri2_create_screen(), which uses
* driver_name + loader_extensions. No separate load call needed.
*/
dri2_dpy->loader_extensions = kopper_loader_extensions;
return true;
}
@@ -273,6 +308,8 @@ dri2_initialize_redox(_EGLDisplay *disp)
dri2_setup_screen(disp);
dri2_add_pbuffer_configs_for_visuals(disp);
dri2_add_config_for_visuals(dri2_dpy, disp, 0, EGL_WINDOW_BIT);
dri2_dpy->vtbl = &dri2_redox_display_vtbl;
return EGL_TRUE;