Add an SSH param to disable updates (#1807)

* disable updates with optional param

* dont create the alert

* Revert "dont create the alert"

This reverts commit 7179a6c8b4.

* keep alert, but allow engagement

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
pull/1809/head
George Hotz 5 years ago committed by GitHub
parent 1036c68251
commit cb495bb8c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      common/params.py
  2. 2
      selfdrive/controls/controlsd.py
  3. 3
      selfdrive/updated.py

@ -60,6 +60,7 @@ keys = {
"CompletedTrainingVersion": [TxType.PERSISTENT], "CompletedTrainingVersion": [TxType.PERSISTENT],
"ControlsParams": [TxType.PERSISTENT], "ControlsParams": [TxType.PERSISTENT],
"DisablePowerDown": [TxType.PERSISTENT], "DisablePowerDown": [TxType.PERSISTENT],
"DisableUpdates": [TxType.PERSISTENT],
"DoUninstall": [TxType.CLEAR_ON_MANAGER_START], "DoUninstall": [TxType.CLEAR_ON_MANAGER_START],
"DongleId": [TxType.PERSISTENT], "DongleId": [TxType.PERSISTENT],
"GitBranch": [TxType.PERSISTENT], "GitBranch": [TxType.PERSISTENT],

@ -72,7 +72,7 @@ class Controls:
params = Params() params = Params()
self.is_metric = params.get("IsMetric", encoding='utf8') == "1" self.is_metric = params.get("IsMetric", encoding='utf8') == "1"
self.is_ldw_enabled = params.get("IsLdwEnabled", 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" community_feature_toggle = params.get("CommunityFeaturesToggle", encoding='utf8') == "1"
openpilot_enabled_toggle = params.get("OpenpilotEnabledToggle", encoding='utf8') == "1" openpilot_enabled_toggle = params.get("OpenpilotEnabledToggle", encoding='utf8') == "1"
passive = params.get("Passive", encoding='utf8') == "1" or \ passive = params.get("Passive", encoding='utf8') == "1" or \

@ -319,6 +319,9 @@ def main():
wait_helper = WaitTimeHelper() wait_helper = WaitTimeHelper()
params = Params() params = Params()
if params.get("DisableUpdates") == b"1":
raise RuntimeError("updates are disabled by param")
if not os.geteuid() == 0: if not os.geteuid() == 0:
raise RuntimeError("updated must be launched as root!") raise RuntimeError("updated must be launched as root!")

Loading…
Cancel
Save