From 1bf15309f3444ac92c747a450923c84c9a0fcfc3 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Wed, 1 Jul 2020 11:17:48 -0700 Subject: [PATCH] disable updates with optional param --- common/params.py | 1 + selfdrive/updated.py | 3 +++ 2 files changed, 4 insertions(+) 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/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!")