From d882752efa4f933cde3935e14e3ff197594a9303 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 10 May 2022 23:52:07 -0700 Subject: [PATCH] Add code to stop updates on C2 --- selfdrive/common/params.cc | 1 + selfdrive/controls/lib/alerts_offroad.json | 4 ++++ selfdrive/thermald/thermald.py | 3 +++ selfdrive/updated.py | 6 +++--- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/selfdrive/common/params.cc b/selfdrive/common/params.cc index 987fc634d7048b..9ad0d3c6fca630 100644 --- a/selfdrive/common/params.cc +++ b/selfdrive/common/params.cc @@ -174,6 +174,7 @@ std::unordered_map keys = { {"Offroad_TemperatureTooHigh", CLEAR_ON_MANAGER_START}, {"Offroad_UnofficialHardware", CLEAR_ON_MANAGER_START}, {"Offroad_UpdateFailed", CLEAR_ON_MANAGER_START}, + {"Offroad_NoMoreUpdates", PERSISTENT}, }; } // namespace diff --git a/selfdrive/controls/lib/alerts_offroad.json b/selfdrive/controls/lib/alerts_offroad.json index 4affe0cfe30af5..20255ee9e3f706 100644 --- a/selfdrive/controls/lib/alerts_offroad.json +++ b/selfdrive/controls/lib/alerts_offroad.json @@ -21,6 +21,10 @@ "severity": 1, "_comment": "Append the command and error to the text." }, + "Offroad_NoMoreUpdates": { + "text": "SA-master has been updated to a commit that deprecates C2 support, your device will no longer update on this branch.", + "severity": 1 + }, "Offroad_InvalidTime": { "text": "Invalid date and time settings, system won't start. Connect to internet to set time.", "severity": 1 diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index f1cc947ee835af..1768b897880f15 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -407,6 +407,9 @@ def thermald_thread() -> NoReturn: if EON and not is_uno: set_offroad_alert_if_changed("Offroad_ChargeDisabled", (not usb_power)) + if EON: + set_offroad_alert("Offroad_NoMoreUpdates", True) + params.put_bool("DisableUpdates", True) should_start_prev = should_start startup_conditions_prev = startup_conditions.copy() diff --git a/selfdrive/updated.py b/selfdrive/updated.py index b8df596b3b1970..a226a37855501e 100755 --- a/selfdrive/updated.py +++ b/selfdrive/updated.py @@ -391,9 +391,9 @@ def main() -> None: auto_reboot = AutoReboot() params = Params() - if params.get_bool("DisableUpdates"): - cloudlog.warning("updates are disabled by the DisableUpdates param") - exit(0) + # if params.get_bool("DisableUpdates"): + # cloudlog.warning("updates are disabled by the DisableUpdates param") + # exit(0) ov_lock_fd = open(LOCK_FILE, 'w') try: