Automatic backups

This commit is contained in:
James
2026-01-02 18:14:19 -07:00
parent e97b9aca53
commit 3832c73da9
6 changed files with 497 additions and 9 deletions
+8 -4
View File
@@ -46,9 +46,13 @@ def manager_init() -> None:
# set unset params to their default value
for k in params.all_keys():
default_value = params.get_default_value(k)
if default_value is not None and params.get(k) is None:
params.put(k, default_value)
current_value = params.get(k)
if current_value is None:
cached_value = params_cache.get(k)
if cached_value is not None:
params.put(k, cached_value)
else:
params_cache.put(k, current_value)
# Create folders needed for msgq
try:
@@ -101,7 +105,7 @@ def manager_init() -> None:
# FrogPilot variables
install_frogpilot(params)
frogpilot_boot_functions(params)
frogpilot_boot_functions(build_metadata, params)
def manager_cleanup() -> None:
+4 -1
View File
@@ -22,7 +22,7 @@ from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert
from openpilot.system.hardware import AGNOS, HARDWARE
from openpilot.system.version import get_build_metadata
from openpilot.frogpilot.common.frogpilot_variables import get_frogpilot_toggles
from openpilot.frogpilot.common.frogpilot_variables import BACKUP_PATH, get_frogpilot_toggles
LOCK_FILE = os.getenv("UPDATER_LOCK_FILE", "/tmp/safe_staging_overlay.lock")
STAGING_ROOT = os.getenv("UPDATER_STAGING_ROOT", "/data/safe_staging")
@@ -414,6 +414,9 @@ class Updater:
cloudlog.info("finalize success!")
# FrogPilot variables
if os.path.isfile(BACKUP_PATH):
os.remove(BACKUP_PATH)
self.params.put("Updated", datetime.datetime.now().astimezone(ZoneInfo("America/Phoenix")).strftime("%B %d, %Y - %I:%M%p"))
def main() -> None: