14 lines
572 B
Python
14 lines
572 B
Python
"""Isolated interpreter; only root-owned pinned runtime and product code on sys.path."""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
root = Path("/var/lib/mission-core-node-drivers")
|
|
path = Path((root / "active.path").read_text())
|
|
if path.parent != root or not path.name.isalnum() or path.is_symlink() or path.stat().st_uid != 0:
|
|
raise RuntimeError("Invalid driver installation")
|
|
sys.path[:0] = [str(path), "/usr/lib/mission-core-node/sensors", "/usr/lib/mission-core-node/sdk"]
|
|
from server import main # noqa: E402 — use only the verified isolated runtime above
|
|
|
|
main()
|