Rollback OTA update if launcher fails to start

This commit is contained in:
Thomas Farstrike
2025-11-12 12:16:12 +01:00
parent 9ba9504f6d
commit e24e65b401
2 changed files with 18 additions and 8 deletions
+9 -1
View File
@@ -1,6 +1,14 @@
0.3.2
=====
- Settings app: add "Auto Start App" setting
- Fri3d-2024 Badge: use same SPI freq as Waveshare 2 inch for uniformity
- ESP32: reduce drawing frequency increasing task_handler duration from 1ms to 5ms
- Tweak gesture navigation to trigger back and top menu more easily
- Rollback OTA update if launcher fails to start
0.3.1
=====
- OSUpdate app: fix typo that caused update rollback
- OSUpdate app: fix typo that prevented update rollback from being cancelled
- Fix 'Home' button in top menu not stopping all apps
- Update micropython-nostr library to fix epoch time on ESP32 and NWC event kind
+9 -7
View File
@@ -74,15 +74,17 @@ except Exception as e:
# Start launcher so it's always at bottom of stack
launcher_app = PackageManager.get_launcher()
mpos.apps.start_app(launcher_app.fullname)
started_launcher = mpos.apps.start_app(launcher_app.fullname)
# Then start another app if configured
auto_start_app = prefs.get_string("auto_start_app", None)
if auto_start_app and launcher_app.fullname != auto_start_app:
mpos.apps.start_app(auto_start_app)
# If we got this far without crashing, then no need to rollback the update:
try:
import ota.rollback
ota.rollback.cancel()
except Exception as e:
print("main.py: warning: could not mark this update as valid:", e)
if not started_launcher:
print("WARNING: launcher {launcher_app} failed to start, not cancelling OTA update rollback")
else:
try:
import ota.rollback
ota.rollback.cancel()
except Exception as e:
print("main.py: warning: could not mark this update as valid:", e)