Block users from using development branches

This commit is contained in:
James
2025-12-01 12:00:00 -07:00
parent ffd7259193
commit b2d94a9f0d
13 changed files with 67 additions and 10 deletions
+9 -2
View File
@@ -12,8 +12,9 @@ from openpilot.common.time_helpers import system_time_valid
from openpilot.system.hardware import HARDWARE
from openpilot.frogpilot.common.frogpilot_backups import backup_frogpilot
from openpilot.frogpilot.common.frogpilot_utilities import run_cmd
from openpilot.frogpilot.common.frogpilot_utilities import is_FrogsGoMoo, run_cmd
from openpilot.frogpilot.common.frogpilot_variables import (
FROGS_GO_MOO_PATH,
FrogPilotVariables
)
@@ -33,7 +34,7 @@ def frogpilot_boot_functions(build_metadata, params):
threading.Thread(target=boot_thread, daemon=True).start()
def install_frogpilot(params):
def install_frogpilot(build_metadata, params):
paths = [
]
for path in paths:
@@ -44,6 +45,12 @@ def install_frogpilot(params):
update_boot_logo(frogpilot=True)
if build_metadata.channel == "FrogPilot-Development" and is_FrogsGoMoo():
mount_options = run_cmd(["findmnt", "-n", "-o", "OPTIONS", "/persist"], "Successfully retrieved mount options", "Failed to retrieve mount options")
run_cmd(["sudo", "mount", "-o", "remount,rw", "/persist"], "Successfully remounted /persist as read-write", "Failed to remount /persist")
run_cmd(["sudo", "python3", FROGS_GO_MOO_PATH], "Successfully ran frogsgomoo.py", "Failed to run frogsgomoo.py")
run_cmd(["sudo", "mount", "-o", f"remount,{mount_options}", "/persist"], "Successfully restored /persist mount options", "Failed to restore /persist mount options")
def uninstall_frogpilot():
update_boot_logo(stock=True)
+6 -1
View File
@@ -13,7 +13,7 @@ import openpilot.system.sentry as sentry
from cereal import messaging
from openpilot.frogpilot.common.frogpilot_variables import EARTH_RADIUS
from openpilot.frogpilot.common.frogpilot_variables import EARTH_RADIUS, FROGS_GO_MOO_PATH
class ThreadManager:
def __init__(self):
@@ -103,6 +103,11 @@ def extract_zip(zip_file, extract_path):
print(f"Extraction completed!")
@cache
def is_FrogsGoMoo():
return FROGS_GO_MOO_PATH.is_file()
def is_url_pingable(url):
if not url:
return False
+6 -1
View File
@@ -62,6 +62,8 @@ BACKUP_PATH = Path("/cache/on_backup")
FROGPILOT_BACKUPS = Path("/data/backups")
TOGGLE_BACKUPS = Path("/data/toggle_backups")
FROGS_GO_MOO_PATH = Path("/persist/frogsgomoo.py")
MAPD_PATH = Path("/data/media/0/osm/mapd")
MAPS_PATH = Path("/data/media/0/osm/offline")
@@ -143,6 +145,9 @@ class FrogPilotVariables:
self.testing_branch = branch == "FrogPilot-Testing"
self.vetting_branch = branch == "FrogPilot-Vetting"
self.frogs_go_moo = FROGS_GO_MOO_PATH.is_file()
toggle.block_user = (self.development_branch or branch == "MAKE-PRS-HERE" or self.vetting_branch) and not self.frogs_go_moo
self.update()
def get_value(self, key, cast=bool, condition=True, conversion=None, default=None, min=None, max=None):
@@ -273,7 +278,7 @@ class FrogPilotVariables:
toggle.always_on_lateral_main = toggle.always_on_lateral and not prohibited_main_aol and not toggle.always_on_lateral_lkas
toggle.always_on_lateral_pause_speed = self.get_value("PauseAOLOnBrake", cast=float, condition=toggle.always_on_lateral)
toggle.automatic_updates = self.get_value("AutomaticUpdates", condition=(self.release_branch or self.vetting_branch), default=True) and not BACKUP_PATH.is_file()
toggle.automatic_updates = self.get_value("AutomaticUpdates", condition=(self.release_branch or self.vetting_branch or self.frogs_go_moo), default=True) and not BACKUP_PATH.is_file()
car_model = self.params.get("CarModel")
toggle.force_fingerprint = self.get_value("ForceFingerprint", condition=car_model != self.default_values["CarModel"])