#!/usr/bin/env python3 """Installed-image, injected-touch regression. Run only on the reserved board.""" import datetime, hashlib, json, os, pathlib, signal, socket, subprocess, sys, time sys.path.insert(0, '/run') import rollback_check as pixels os.environ.update(XDG_RUNTIME_DIR='/run/shell', WAYLAND_DISPLAY='wayland-1', SWAYSOCK='/run/shell/sway-ipc.sock') OUT=pathlib.Path('/run/card-board-restore'); OUT.mkdir(exist_ok=True) result={'provenance':'injected-touch on physical board; no real-finger claim', 'at_utc':datetime.datetime.now(datetime.timezone.utc).isoformat(), 'checks':{}} result['system']=os.path.realpath('/run/current-system') result['boot_id']=pathlib.Path('/proc/sys/kernel/random/boot_id').read_text().strip() def command(args): return subprocess.check_output(args, text=True, timeout=15) def wait(test,label,seconds=15): end=time.monotonic()+seconds while time.monotonic()