magic: robust init (#497)

* perm

* check

* wheel
This commit is contained in:
Maxime Desroches
2025-10-16 23:50:33 -07:00
committed by GitHub
parent dcca2408bc
commit 87fc4745e5
4 changed files with 15 additions and 8 deletions
+2 -2
View File
@@ -10,13 +10,13 @@ RESET_TRIGGER="/data/__system_reset__"
echo "waiting for magic"
for i in {1..200}; do
if systemctl is-active --quiet magic; then
if systemctl is-active --quiet magic && [ -S /tmp/drmfd.sock ]; then
break
fi
sleep 0.1
done
if systemctl is-active --quiet magic; then
if systemctl is-active --quiet magic && [ -S /tmp/drmfd.sock ]; then
echo "magic ready after ${SECONDS}s"
else
echo "timed out waiting for magic, ${SECONDS}s"
+9 -2
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
import os, socket, struct, subprocess, threading
import os, socket, struct, subprocess, threading, time
from array import array
import pyray as rl
@@ -84,7 +84,14 @@ def handle_client(client, drm_master):
def main():
threading.Thread(target=updater_weston, daemon=True).start()
drm_master = os.open(DRM_DEVICE, os.O_RDWR | os.O_CLOEXEC)
while True:
try:
drm_master = os.open(DRM_DEVICE, os.O_RDWR | os.O_CLOEXEC)
break
except Exception as e:
print(e)
time.sleep(0.1)
os.environ['DRM_FD'] = str(drm_master)
rl.init_window(0, 0, "not weston")
img = rl.load_image(BACKGROUND)
+1 -1
View File
@@ -32,7 +32,7 @@ dependencies = [
"flaky",
# GUIs
"raylib @ https://github.com/commaai/raylib-python-cffi/releases/download/4/raylib-5.5.0.2-cp312-cp312-linux_aarch64.whl",
"raylib @ https://github.com/commaai/raylib-python-cffi/releases/download/5/raylib-5.5.0.2-cp312-cp312-linux_aarch64.whl",
]
[tool.uv.sources]
+3 -3
View File
@@ -56,7 +56,7 @@ requires-dist = [
{ name = "py-spy" },
{ name = "pyopencl", specifier = "==2024.1" },
{ name = "pyusb" },
{ name = "raylib", url = "https://github.com/commaai/raylib-python-cffi/releases/download/4/raylib-5.5.0.2-cp312-cp312-linux_aarch64.whl" },
{ name = "raylib", url = "https://github.com/commaai/raylib-python-cffi/releases/download/5/raylib-5.5.0.2-cp312-cp312-linux_aarch64.whl" },
{ name = "smbus2" },
{ name = "spidev2" },
]
@@ -5653,12 +5653,12 @@ wheels = [
[[package]]
name = "raylib"
version = "5.5.0.2"
source = { url = "https://github.com/commaai/raylib-python-cffi/releases/download/4/raylib-5.5.0.2-cp312-cp312-linux_aarch64.whl" }
source = { url = "https://github.com/commaai/raylib-python-cffi/releases/download/5/raylib-5.5.0.2-cp312-cp312-linux_aarch64.whl" }
dependencies = [
{ name = "cffi" },
]
wheels = [
{ url = "https://github.com/commaai/raylib-python-cffi/releases/download/4/raylib-5.5.0.2-cp312-cp312-linux_aarch64.whl", hash = "sha256:d32619e003cc55b0ca4df5dde421e654e691600d4071dd12458d374ca5d2070b" },
{ url = "https://github.com/commaai/raylib-python-cffi/releases/download/5/raylib-5.5.0.2-cp312-cp312-linux_aarch64.whl", hash = "sha256:cc38da3f0938d54ff498fe6dc7c597fbc7d3dff68b0198d495ef269a19a9c872" },
]
[package.metadata]