From 64b7f5b40121b09e97b7d48c81eec390510ae055 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Fri, 12 Jan 2024 22:39:30 -0700 Subject: [PATCH] Fast boot using prebuilt file Added prebuilt functionality that removes itself whenever the user installs updates to prevent installation failures. --- selfdrive/manager/manager.py | 4 ++++ selfdrive/thermald/thermald.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/selfdrive/manager/manager.py b/selfdrive/manager/manager.py index 339a776..4646f96 100755 --- a/selfdrive/manager/manager.py +++ b/selfdrive/manager/manager.py @@ -195,6 +195,10 @@ def main() -> None: manager_init() + # Remove the prebuilt file to prevent boot failures + if os.path.exists("/data/openpilot/prebuilt"): + os.remove("/data/openpilot/prebuilt") + # Start UI early so prepare can happen in the background if not prepare_only: managed_processes['ui'].start() diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 413b329..beb85f9 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -457,6 +457,9 @@ def thermald_thread(end_event, hw_queue) -> None: count += 1 should_start_prev = should_start + # Create the prebuilt file if it doesn't exist + if not os.path.isfile('/data/openpilot/prebuilt'): + os.system(f"touch {'/data/openpilot/prebuilt'}") def main(): hw_queue = queue.Queue(maxsize=1)