kde/Plasma: mesa-swrast (GL software) + lanzador Plasma headless + handoff nocturno

- run-plasma-headless.sh: lanzador de sesión Plasma headless (software EGL/softpipe sobre KMS).
- mesa-swrast construido (softpipe, sin LLVM, sello c59738eb): swrast_dri/kms_swrast_dri.
- HANDOFF-noche-kde: kwin_wayland linkea+carga QPA pero create() del compositor crashea headless
  (virtio-gpu/EGL-sw/seat en musl, opaco sin gdb). El rootfs es para GPU Intel real (iris) →
  camino recomendado = imagen booteable para metal (laptop TigerLake). Estado + próximos pasos.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-13 23:56:59 -04:00
co-authored by Claude Opus 4.8
parent a7449a0b88
commit 725adbd487
2 changed files with 112 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
# run-plasma-headless.sh — intenta levantar la sesión Plasma (kwin_wayland + plasmashell) HEADLESS con
# render por SOFTWARE (mesa-swrast/softpipe) sobre el KMS del worker (/dev/dri/card1), dentro del rootfs
# musl soberano. Objetivo: hito H-shell ("escritorio prende") sin GPU real ni metal.
#
# Requiere: work/kde-store-rootfs hidratado + cierre completo (hydrate-from-store.sh + complete-closure.sh)
# + mesa-swrast hidratado (kms_swrast_dri.so / softpipe).
# Corre EN el worker (host glibc): binarios musl vía loader del .dev-fs + LD path del rootfs.
set -uo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"; cd "$ROOT"
R="${RFS:-$ROOT/work/kde-store-rootfs}"; A="$ROOT/.dev-fs/alpine"
LOADER="$A/lib/ld-musl-x86_64.so.1"
SECS="${SECS:-20}"
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/tmp/plasma-xdg}"; mkdir -p "$XDG_RUNTIME_DIR"; chmod 700 "$XDG_RUNTIME_DIR"
# LD path = todos los dirs con .so del rootfs + sysroot
LIBS=$(find "$R" "$A" -name "*.so*" -printf '%h\n' 2>/dev/null | sort -u | tr '\n' ':')
# rutas de plugins/qml/datos del rootfs (lib64 y lib)
export QT_PLUGIN_PATH="$R/usr/lib64/qt6/plugins:$R/usr/lib/qt6/plugins"
export QML2_IMPORT_PATH="$R/usr/lib64/qt6/qml:$R/usr/lib/qt6/qml"
export QML_IMPORT_PATH="$QML2_IMPORT_PATH"
export XDG_DATA_DIRS="$R/usr/share"
export XDG_CONFIG_HOME="$XDG_RUNTIME_DIR/config"; mkdir -p "$XDG_CONFIG_HOME"
export QT_QPA_PLATFORM_PLUGIN_PATH="$QT_PLUGIN_PATH/platforms"
# software render: softpipe (mesa-swrast), sin aceleración
export LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=softpipe
export LIBGL_DRIVERS_PATH="$R/usr/lib/dri:$R/usr/lib64/dri"
export __EGL_VENDOR_LIBRARY_DIRS="$R/usr/share/glvnd/egl_vendor.d"
export QT_QUICK_BACKEND=software # QtQuick por software (plasmashell)
export KWIN_COMPOSE="${KWIN_COMPOSE:-Q}" # Q = QPainter (compositing por software, sin GL) si aplica
export QT_LOGGING_RULES="kwin_*.debug=false"
run() { "$LOADER" --library-path "$LIBS" "$@"; }
echo "==> lanzando kwin_wayland (drm sw / softpipe) ${SECS}s"
KW=$(find "$R" -name kwin_wayland -type f | head -1)
# --drm sobre el KMS del worker; sin lockscreen; salida virtual si drm falla
run "$KW" --no-lockscreen --width 1280 --height 800 \
-- "$LOADER" --library-path "$LIBS" "$(find "$R" -name plasmashell -type f|head -1)" \
>"$ROOT/work/plasma-headless.log" 2>&1 &
KPID=$!
sleep "$SECS"
echo "==> log (kwin+plasmashell):"; tail -40 "$ROOT/work/plasma-headless.log"
echo "==> sockets wayland en XDG_RUNTIME_DIR:"; ls -la "$XDG_RUNTIME_DIR"/wayland-* 2>/dev/null || echo " (ninguno)"
kill "$KPID" 2>/dev/null; pkill -f kwin_wayland 2>/dev/null; pkill -f plasmashell 2>/dev/null