Add signed passive runtime updates and independent crash recovery

This commit is contained in:
Codex
2026-10-13 21:38:44 +03:00
parent c43c0977f6
commit 98022dd355
8 changed files with 1314 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/python3 -I
"""Independent trusted updater launcher; does not import the mutable runtime."""
from pathlib import Path
import runpy
path = Path(__file__).resolve()
if path.parent == Path('/usr/bin'):
engine = Path('/usr/lib/hydra-update/engine.py')
else:
# Source checkout only. Installed launchers never fall back to mutable code.
engine = path.parent.parent / 'hydra/update_engine.py'
raise SystemExit(runpy.run_path(str(engine))['main']())
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/python3 -I
"""Recover without importing any module from the mutable Hydra runtime."""
from pathlib import Path
import runpy
path = Path(__file__).resolve()
engine = Path('/usr/lib/hydra-update/engine.py') if path.parent == Path('/usr/bin') else path.parent.parent / 'hydra/update_engine.py'
raise SystemExit(runpy.run_path(str(engine))['main'](recovery=True))