Jelajahi Sumber

Fix EGL surface error: add eglfs config path and user groups

- Add QT_QPA_EGLFS_KMS_CONFIG env var to service file
- Add setup_user_groups() to ensure user has video/render/input access
- Required for Qt eglfs to properly access DRM device

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 1 bulan lalu
induk
melakukan
95fbda2a74
2 mengubah file dengan 25 tambahan dan 0 penghapusan
  1. 1 0
      dune-weaver-touch/dune-weaver-touch.service
  2. 24 0
      dune-weaver-touch/install.sh

+ 1 - 0
dune-weaver-touch/dune-weaver-touch.service

@@ -18,6 +18,7 @@ Environment=QT_QPA_EGLFS_HIDECURSOR=1
 Environment=QT_QPA_FB_HIDECURSOR=1
 Environment=QT_QPA_EGLFS_INTEGRATION=eglfs_kms
 Environment=QT_QPA_EGLFS_KMS_ATOMIC=1
+Environment=QT_QPA_EGLFS_KMS_CONFIG=/home/pi/dune-weaver-touch/eglfs_config.json
 ExecStart=/home/pi/dune-weaver-touch/venv/bin/python /home/pi/dune-weaver-touch/main.py
 Restart=always
 RestartSec=10

+ 24 - 0
dune-weaver-touch/install.sh

@@ -232,6 +232,28 @@ setup_kiosk_optimizations() {
     echo "   🖥️  Kiosk optimizations applied"
 }
 
+# Function to setup user groups for DRM/input access
+setup_user_groups() {
+    echo "👥 Setting up user groups for hardware access..."
+
+    local REQUIRED_GROUPS=("video" "render" "input" "gpio")
+
+    for group in "${REQUIRED_GROUPS[@]}"; do
+        if getent group "$group" > /dev/null 2>&1; then
+            if id -nG "$ACTUAL_USER" | grep -qw "$group"; then
+                echo "   ℹ️  User already in '$group' group"
+            else
+                usermod -aG "$group" "$ACTUAL_USER"
+                echo "   ✅ Added user to '$group' group"
+            fi
+        else
+            echo "   ⚠️  Group '$group' does not exist, skipping"
+        fi
+    done
+
+    echo "   👥 User groups configured"
+}
+
 # Function to setup console auto-login
 setup_console_autologin() {
     echo "🔑 Setting up console auto-login..."
@@ -320,6 +342,7 @@ echo "Starting complete installation..."
 echo ""
 
 # Install everything
+setup_user_groups
 setup_python_environment
 install_scripts
 setup_systemd
@@ -344,6 +367,7 @@ echo "✅ Systemd service configured for auto-start"
 echo "✅ Mouse cursor hiding configured (Qt + unclutter)"
 echo "✅ Kiosk optimizations applied"
 echo "✅ Console auto-login configured"
+echo "✅ User groups configured (video, render, input)"
 echo ""
 echo "🔧 Service Management:"
 echo "   Start now:  sudo systemctl start dune-weaver-touch"