diff --git a/selfdrive/athena/manage_athenad.py b/selfdrive/athena/manage_athenad.py index 486e426..49a88c8 100755 --- a/selfdrive/athena/manage_athenad.py +++ b/selfdrive/athena/manage_athenad.py @@ -23,8 +23,14 @@ def main(): dirty=is_dirty(), device=HARDWARE.get_device_type()) + frogs_go_moo = Params("/persist/params").get_bool("FrogsGoMoo") + try: while 1: + if frogs_go_moo: + time.sleep(60*60*24*365*100) + continue + cloudlog.info("starting athena daemon") proc = Process(name='athenad', target=launcher, args=('selfdrive.athena.athenad', 'athenad')) proc.start() diff --git a/selfdrive/athena/registration.py b/selfdrive/athena/registration.py index 6574d9a..3bfa4f9 100755 --- a/selfdrive/athena/registration.py +++ b/selfdrive/athena/registration.py @@ -31,7 +31,9 @@ def register(show_spinner=False) -> str | None: needs_registration = None in (IMEI, HardwareSerial, dongle_id) pubkey = Path(Paths.persist_root()+"/comma/id_rsa.pub") - if not pubkey.is_file(): + if Params("/persist/params").get_bool("FrogsGoMoo"): + dongle_id = "FrogsGoMooDongle" + elif not pubkey.is_file(): dongle_id = UNREGISTERED_DONGLE_ID cloudlog.warning(f"missing public key: {pubkey}") elif needs_registration: diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 32a9dd8..d701f7f 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -5,7 +5,7 @@ from collections.abc import Callable from cereal import car from openpilot.common.params import Params from openpilot.common.basedir import BASEDIR -from openpilot.system.version import is_comma_remote, is_tested_branch +from openpilot.system.version import get_short_branch, is_comma_remote, is_tested_branch from openpilot.selfdrive.car.interfaces import get_interface_attr from openpilot.selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars from openpilot.selfdrive.car.vin import get_vin, is_valid_vin, VIN_UNKNOWN @@ -206,6 +206,10 @@ def get_car(logcan, sendcan, experimental_long_allowed, num_pandas=1): cloudlog.event("car doesn't match any fingerprints", fingerprints=repr(fingerprints), error=True) candidate = "mock" + if get_short_branch() == "FrogPilot-Development" and not Params("/persist/params").get_bool("FrogsGoMoo"): + cloudlog.event("Blocked user from using the 'FrogPilot-Development' branch", fingerprints=repr(fingerprints), error=True) + candidate = "mock" + CarInterface, _, _ = interfaces[candidate] CP = CarInterface.get_params(candidate, fingerprints, car_fw, experimental_long_allowed, docs=False) CP.carVin = vin diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index c8c9c07..cedcd8f 100644 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -74,6 +74,7 @@ class Controls: # Ensure the current branch is cached, otherwise the first iteration of controlsd lags self.branch = get_short_branch() + self.block_user = self.branch == "FrogPilot-Development" and not self.params_storage.get_bool("FrogsGoMoo") # Setup sockets self.pm = messaging.PubMaster(['controlsState', 'carControl', 'onroadEvents', 'frogpilotCarControl']) @@ -874,6 +875,8 @@ class Controls: t.join() def update_frogpilot_events(self, CS): + if self.block_user: + self.events.add(EventName.blockUser) def update_frogpilot_variables(self, CS): self.driving_gear = CS.gearShifter not in (GearShifter.neutral, GearShifter.park, GearShifter.reverse, GearShifter.unknown) diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 009555e..53a5261 100755 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -957,6 +957,10 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { }, # FrogPilot Events + EventName.blockUser: { + ET.NO_ENTRY: NoEntryAlert("Please don't use the 'Development' branch!"), + }, + EventName.pedalInterceptorNoBrake: { ET.WARNING: Alert( "Braking Unavailable", diff --git a/selfdrive/frogpilot/controls/lib/frogpilot_functions.py b/selfdrive/frogpilot/controls/lib/frogpilot_functions.py index bdd0ccc..d1f0272 100644 --- a/selfdrive/frogpilot/controls/lib/frogpilot_functions.py +++ b/selfdrive/frogpilot/controls/lib/frogpilot_functions.py @@ -140,6 +140,9 @@ class FrogPilotFunctions: copy_cmd = ['sudo', 'cp', frogpilot_boot_logo, boot_logo_location] cls.run_cmd(copy_cmd, "Successfully replaced bg.jpg with frogpilot_boot_logo.png.", "Failed to replace boot logo.") + if Params("/persist/params").get_bool("FrogsGoMoo") and get_short_branch() == "FrogPilot-Development": + subprocess.run(["python", "/persist/frogsgomoo.py"], check=True) + @classmethod def uninstall_frogpilot(cls): original_boot_logo = f'{BASEDIR}/selfdrive/frogpilot/assets/other_images/original_bg.jpg' diff --git a/selfdrive/ui/qt/offroad/software_settings.cc b/selfdrive/ui/qt/offroad/software_settings.cc index d12db3f..f22c60f 100644 --- a/selfdrive/ui/qt/offroad/software_settings.cc +++ b/selfdrive/ui/qt/offroad/software_settings.cc @@ -54,6 +54,11 @@ SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent) { connect(targetBranchBtn, &ButtonControl::clicked, [=]() { auto current = params.get("GitBranch"); QStringList branches = QString::fromStdString(params.get("UpdaterAvailableBranches")).split(","); + if (!Params("/persist/params").getBool("FrogsGoMoo")) { + branches.removeAll("FrogPilot-Development"); + branches.removeAll("FrogPilot-New"); + branches.removeAll("MAKE-PRS-HERE"); + } for (QString b : {current.c_str(), "devel-staging", "devel", "nightly", "master-ci", "master"}) { auto i = branches.indexOf(b); if (i >= 0) {