D-Bus Phase 3/4: upgrade sessiond, services, add StatusNotifierWatcher, consolidate configs

- redbear-sessiond: add Manager.Inhibit (pipe FD), CanPowerOff/CanReboot/
  CanSuspend/CanHibernate/CanHybridSleep/CanSleep (return na), PowerOff/
  Reboot/Suspend stubs, GetSessionByPID, ListUsers, ListSeats,
  ListInhibitors, ActivateSession/LockSession/UnlockSession/TerminateSession
- redbear-sessiond: add Session SetIdleHint, SetLockedHint, SetType,
  Terminate methods; wire PauseDevice/ResumeDevice/Lock/Unlock signal
  emission via SignalEmitter injection; add dynamic device enumeration
  scanning /scheme/drm/card* and /dev/input/event* at startup
- redbear-sessiond: replace infinite pending() with stoppable shutdown
  via tokio watch channel + control socket shutdown command
- redbear-upower: add Changed signal emission with 30s periodic polling
  and power state snapshot comparison
- redbear-notifications: add ActionInvoked signal, expand capabilities
  to body + body-markup + actions
- redbear-polkit, redbear-udisks: replace pending() with stoppable
  shutdown via signal handling + watch channel
- Add redbear-statusnotifierwatcher: new session bus service implementing
  org.freedesktop.StatusNotifierWatcher for KDE system tray
- Add D-Bus activation file for StatusNotifierWatcher
- KWin session.cpp: try LogindSession before NoopSession fallback
- Consolidate config profiles: remove obsolete redbear-desktop, redbear-kde,
  redbear-live-*, redbear-minimal-*, redbear-wayland configs; simplify
  to three supported targets (redbear-full, redbear-mini, redbear-grub)
- Update DBUS-INTEGRATION-PLAN.md and DESKTOP-STACK-CURRENT-STATUS.md
  with Phase 3/4 fragility assessment, KWin readiness matrix, and
  completeness gap analysis
This commit is contained in:
2026-04-25 12:01:25 +01:00
parent 0bd58c912f
commit dc69317ddf
55 changed files with 1535 additions and 1932 deletions
+9 -80
View File
@@ -1,20 +1,4 @@
#!/usr/bin/env bash
# build-redbear.sh — Build Red Bear OS from upstream base + Red Bear overlay
#
# Usage:
# ./local/scripts/build-redbear.sh # Default: redbear-full
# ./local/scripts/build-redbear.sh redbear-mini # Minimal validation baseline
# ./local/scripts/build-redbear.sh redbear-full # Full Red Bear desktop/session target
# ./local/scripts/build-redbear.sh redbear-live # Canonical full live profile config
# ./local/scripts/build-redbear.sh redbear-live-mini # Text-only mini live profile config
# ./local/scripts/build-redbear.sh redbear-grub-live-mini # Text-only GRUB mini live profile config
# ./local/scripts/build-redbear.sh --upstream redbear-full # Allow Redox/upstream recipe refresh
# APPLY_PATCHES=0 ./local/scripts/build-redbear.sh # Skip patch application
#
# This script assumes the Red Bear overlay model:
# - upstream-owned sources are refreshable working trees
# - Red Bear-owned shipping deltas live in local/patches/ and local/recipes/
# - upstream WIP recipes are not trusted as stable shipping inputs until upstream promotes them
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
@@ -25,23 +9,6 @@ JOBS="${JOBS:-$(nproc)}"
APPLY_PATCHES="${APPLY_PATCHES:-1}"
ALLOW_UPSTREAM=0
canonicalize_config() {
case "$1" in
redbear-mini)
printf '%s\n' "redbear-minimal"
;;
redbear-live-full)
printf '%s\n' "redbear-live"
;;
redbear-live-mini-grub)
printf '%s\n' "redbear-grub-live-mini"
;;
*)
printf '%s\n' "$1"
;;
esac
}
usage() {
cat <<EOF
Usage: $(basename "$0") [OPTIONS] [CONFIG]
@@ -53,7 +20,9 @@ Options:
-h, --help Show this help
Configs:
redbear-mini, redbear-full, redbear-live, redbear-live-mini, redbear-grub-live-mini
redbear-full Desktop/graphics target (default)
redbear-mini Text-only console/recovery target
redbear-grub Text-only with GRUB boot manager
EOF
}
@@ -87,22 +56,12 @@ fi
[ ${#POSITIONAL[@]} -eq 1 ] && CONFIG="${POSITIONAL[0]}"
CONFIG="$(canonicalize_config "$CONFIG")"
case "$CONFIG" in
redbear-minimal)
;;
redbear-live)
;;
redbear-live-mini)
;;
redbear-grub-live-mini)
;;
redbear-full)
redbear-full|redbear-mini|redbear-grub)
;;
*)
echo "ERROR: Unknown config '$CONFIG'"
echo "Supported: redbear-mini, redbear-full, redbear-live, redbear-live-mini, redbear-grub-live-mini"
echo "ERROR: Unknown config '$CONFIG'" >&2
echo "Supported: redbear-full, redbear-mini, redbear-grub" >&2
exit 1
;;
esac
@@ -216,7 +175,6 @@ if [ "$APPLY_PATCHES" = "1" ]; then
apply_patch_dir "$PROJECT_ROOT/local/patches/bootloader" "$PROJECT_ROOT/recipes/core/bootloader/source" "bootloader"
apply_patch_dir "$PROJECT_ROOT/local/patches/installer" "$PROJECT_ROOT/recipes/core/installer/source" "installer"
# repo cook can refetch nested sources when --upstream is enabled; keep relibc clean after patch application
stash_nested_repo_if_dirty "$PROJECT_ROOT/recipes/core/relibc/source" "relibc"
echo ""
fi
@@ -232,12 +190,12 @@ if [ ! -f "target/release/repo" ]; then
cargo build --release
fi
if [ "$CONFIG" = "redbear-full" ] || [ "$CONFIG" = "redbear-live" ]; then
if [ "$CONFIG" = "redbear-full" ]; then
ensure_relibc_desktop_surface
fi
FW_AMD_DIR="$PROJECT_ROOT/local/firmware/amdgpu"
if [ "$CONFIG" != "redbear-minimal" ] && [ "$CONFIG" != "redbear-live-mini" ] && [ "$CONFIG" != "redbear-grub-live-mini" ]; then
if [ "$CONFIG" = "redbear-full" ]; then
if [ -d "$FW_AMD_DIR" ] && [ -n "$(ls -A "$FW_AMD_DIR" 2>/dev/null)" ]; then
FW_COUNT=$(ls "$FW_AMD_DIR"/*.bin 2>/dev/null | wc -l)
echo ">>> Found $FW_COUNT AMD firmware blobs"
@@ -268,38 +226,9 @@ echo "Image: build/$ARCH/$CONFIG/harddrive.img"
echo ""
echo "To run in QEMU:"
echo " make qemu QEMUFLAGS=\"-m 4G\""
if [ "$CONFIG" = "redbear-minimal" ] || [ "$CONFIG" = "redbear-desktop" ]; then
echo ""
echo "To validate the Phase 2 VM network baseline:"
echo " ./local/scripts/validate-vm-network-baseline.sh"
echo " ./local/scripts/test-vm-network-qemu.sh $CONFIG"
fi
if [ "$CONFIG" = "redbear-desktop" ] || [ "$CONFIG" = "redbear-full" ] || [ "$CONFIG" = "redbear-wayland" ] || [ "$CONFIG" = "redbear-kde" ]; then
echo ""
echo "To validate bounded low-level controller proofs:"
echo " ./local/scripts/test-lowlevel-controllers-qemu.sh $CONFIG"
echo " # or run individual checks: test-xhci-irq-qemu.sh, test-iommu-qemu.sh, test-ps2-qemu.sh, test-timer-qemu.sh"
echo ""
echo "To validate bounded USB maturity proofs:"
echo " ./local/scripts/test-usb-maturity-qemu.sh $CONFIG"
echo " # or run individual checks: test-usb-qemu.sh --check, test-usb-storage-qemu.sh"
fi
if [ "$CONFIG" = "redbear-wayland" ]; then
echo ""
echo "To validate the bounded Phase 4 Wayland runtime harness:"
echo " ./local/scripts/test-phase4-wayland-qemu.sh"
echo " # in guest: redbear-drm-display-check --vendor amd|intel"
fi
if [ "$CONFIG" = "redbear-kde" ]; then
echo ""
echo "To validate the primary KWin Wayland desktop path:"
echo " ./local/scripts/test-phase6-kde-qemu.sh --check"
echo " # in guest: redbear-drm-display-check --vendor amd|intel"
fi
echo ""
echo "To build live ISO:"
echo " make live CONFIG_NAME=$CONFIG"
echo " # live .iso outputs are for real bare metal, not VM/QEMU use"
echo " scripts/build-iso.sh $CONFIG"
echo ""
echo "To write a real bare-metal image to USB (verify device first!):"
echo " dd if=build/$ARCH/$CONFIG/harddrive.img of=/dev/sdX bs=4M status=progress"
+3 -11
View File
@@ -226,16 +226,8 @@ echo ""
section "Validating Red Bear configs..."
declare -a redbear_configs=(
"config/redbear-desktop.toml"
"config/redbear-minimal.toml"
"config/redbear-bluetooth-experimental.toml"
"config/redbear-mini.toml"
"config/redbear-full.toml"
"config/redbear-wayland.toml"
"config/redbear-live.toml"
"config/redbear-live-mini.toml"
"config/redbear-live-full.toml"
"config/redbear-grub-live-mini.toml"
"config/redbear-grub-live-full.toml"
"config/redbear-grub.toml"
)
declare -a found_configs=()
@@ -247,9 +239,9 @@ for config_path in "${redbear_configs[@]}"; do
done
if [ "${#found_configs[@]}" -gt 0 ]; then
status "Found Red Bear config(s): ${found_configs[*]}"
status "Found Red Bear target config(s): ${found_configs[*]}"
else
warn "No redbear config found in config/. Build may rely on a different config intentionally"
warn "No redbear target config found in config/"
fi
echo ""