mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-14 19:44:05 +08:00
updater: zipapp and additional fixes (#37550)
* new updater zipapp * fix deadlock from agnos.py throwing timeout errors, never hitting failed screen! + try catch the whole process for errors while starting process * add todo * set core affinity like setup in updater * fix import * rezip
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c44fb88b3b1643b6b44ae8ac9880348bd0257ff90f4084cbe889de91d71653fe
|
||||
size 25111329
|
||||
oid sha256:d815a9140e69242d85e57f74a14c6372809eebefe8958be9152efa7874928ccc
|
||||
size 71215510
|
||||
|
||||
@@ -5,7 +5,9 @@ import threading
|
||||
import pyray as rl
|
||||
from enum import IntEnum
|
||||
|
||||
from openpilot.system.hardware import HARDWARE
|
||||
from openpilot.common.realtime import config_realtime_process, set_core_affinity
|
||||
from openpilot.system.hardware import HARDWARE, TICI
|
||||
from openpilot.common.swaglog import cloudlog
|
||||
from openpilot.system.ui.lib.application import gui_app, FontWeight
|
||||
from openpilot.system.ui.widgets import Widget
|
||||
from openpilot.system.ui.widgets.label import UnifiedLabel
|
||||
@@ -34,6 +36,7 @@ class Updater(Widget):
|
||||
self._network_monitor = NetworkConnectivityMonitor()
|
||||
self._network_monitor.start()
|
||||
|
||||
# TODO: network page is rendered inline, not pushed on nav stack, so auto-dismiss on internet connect doesn't work
|
||||
self._network_setup_page = NetworkSetupPageBase(self._network_monitor, self._network_setup_continue_callback,
|
||||
disable_connect_hint=True)
|
||||
self._network_setup_page.set_is_updater()
|
||||
@@ -93,9 +96,13 @@ class Updater(Widget):
|
||||
|
||||
def _run_update_process(self):
|
||||
# TODO: just import it and run in a thread without a subprocess
|
||||
cmd = [self.updater, "--swap", self.manifest]
|
||||
self.process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
text=True, bufsize=1, universal_newlines=True)
|
||||
try:
|
||||
cmd = [self.updater, "--swap", self.manifest]
|
||||
self.process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
text=True, bufsize=1, universal_newlines=True)
|
||||
except Exception:
|
||||
self.set_current_screen(Screen.FAILED)
|
||||
return
|
||||
|
||||
if self.process.stdout is not None:
|
||||
for line in self.process.stdout:
|
||||
@@ -169,6 +176,14 @@ class Updater(Widget):
|
||||
|
||||
|
||||
def main():
|
||||
config_realtime_process(0, 51)
|
||||
# attempt to affine. AGNOS will start setup with all cores, should only fail when manually launching with screen off
|
||||
if TICI:
|
||||
try:
|
||||
set_core_affinity([5])
|
||||
except OSError:
|
||||
cloudlog.exception("Failed to set core affinity for updater process")
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print("Usage: updater.py <updater_path> <manifest_path>")
|
||||
sys.exit(1)
|
||||
|
||||
@@ -67,9 +67,14 @@ class Updater(Widget):
|
||||
|
||||
def _run_update_process(self):
|
||||
# TODO: just import it and run in a thread without a subprocess
|
||||
cmd = [self.updater, "--swap", self.manifest]
|
||||
self.process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
text=True, bufsize=1, universal_newlines=True)
|
||||
try:
|
||||
cmd = [self.updater, "--swap", self.manifest]
|
||||
self.process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
text=True, bufsize=1, universal_newlines=True)
|
||||
except Exception:
|
||||
self.progress_text = "Update failed"
|
||||
self.show_reboot_button = True
|
||||
return
|
||||
|
||||
if self.process.stdout is not None:
|
||||
for line in self.process.stdout:
|
||||
|
||||
Reference in New Issue
Block a user