This commit is contained in:
Your Name
2024-04-27 13:03:43 -05:00
parent fe5f722eda
commit 71b83ffe7f
22 changed files with 986 additions and 28 deletions

View File

@@ -1,6 +1,5 @@
from abc import abstractmethod, ABC
from collections import namedtuple
from typing import Dict
from cereal import log
@@ -10,7 +9,7 @@ NetworkType = log.DeviceState.NetworkType
class HardwareBase(ABC):
@staticmethod
def get_cmdline() -> Dict[str, str]:
def get_cmdline() -> dict[str, str]:
with open('/proc/cmdline') as f:
cmdline = f.read()
return {kv[0]: kv[1] for kv in [s.split('=') for s in cmdline.split(' ')] if len(kv) == 2}
@@ -30,6 +29,10 @@ class HardwareBase(ABC):
def reboot(self, reason=None):
pass
@abstractmethod
def soft_reboot(self):
pass
@abstractmethod
def uninstall(self):
pass