diff --git a/common/params.py b/common/params.py index 1b34bb1daa..7b90913e7d 100755 --- a/common/params.py +++ b/common/params.py @@ -60,6 +60,7 @@ keys = { "CompletedTrainingVersion": [TxType.PERSISTENT], "ControlsParams": [TxType.PERSISTENT], "DisablePowerDown": [TxType.PERSISTENT], + "DisableUpdates": [TxType.PERSISTENT], "DoUninstall": [TxType.CLEAR_ON_MANAGER_START], "DongleId": [TxType.PERSISTENT], "GitBranch": [TxType.PERSISTENT], diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 1015a6f19a..43ccc7acb1 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -72,7 +72,7 @@ class Controls: params = Params() self.is_metric = params.get("IsMetric", encoding='utf8') == "1" self.is_ldw_enabled = params.get("IsLdwEnabled", encoding='utf8') == "1" - internet_needed = params.get("Offroad_ConnectivityNeeded", encoding='utf8') is not None + internet_needed = (params.get("Offroad_ConnectivityNeeded", encoding='utf8') is not None) and (params.get("DisableUpdates") != b"1") community_feature_toggle = params.get("CommunityFeaturesToggle", encoding='utf8') == "1" openpilot_enabled_toggle = params.get("OpenpilotEnabledToggle", encoding='utf8') == "1" passive = params.get("Passive", encoding='utf8') == "1" or \ diff --git a/selfdrive/updated.py b/selfdrive/updated.py index 47f2d55a59..7c7db0f323 100755 --- a/selfdrive/updated.py +++ b/selfdrive/updated.py @@ -319,6 +319,9 @@ def main(): wait_helper = WaitTimeHelper() params = Params() + if params.get("DisableUpdates") == b"1": + raise RuntimeError("updates are disabled by param") + if not os.geteuid() == 0: raise RuntimeError("updated must be launched as root!")