Skip to content

sysupgrade: bound the online time sync and show download progress - #2225

Merged
widgetii merged 1 commit into
masterfrom
fix/sysupgrade-progress-timeout
Jul 21, 2026
Merged

sysupgrade: bound the online time sync and show download progress#2225
widgetii merged 1 commit into
masterfrom
fix/sysupgrade-progress-timeout

Conversation

@widgetii

Copy link
Copy Markdown
Member

Two small robustness/UX fixes to the /ws/upgrade firmware-update flow, surfaced by OpenIPC/majestic-webui#120 ("progress gets stuck" — reported on t31x / ssc37x / ssc33x).

Changes (general/overlay/usr/sbin/sysupgrade)

1. Bound the online time sync. sync_time() ran ntpd -Nnq, which can block for minutes when no NTP server is reachable — stranding the upgrade at "Synchronizing time" (the ssc378de report). It's now wrapped in timeout 30 (guarded by command -v timeout, mirroring mount_rootfs). Everything after this fetches over curl -k, so an unsynced clock is not fatal — better to move on than hang.

2. Show download progress. The tgz download used curl -s … -s (fully silent), so the "Download" step looked frozen for up to 2 min (the ssc337de report). It now shows curl's transfer bar (-#); -s (silent_update) still opts back out for a quiet console run. Over /ws/upgrade this also keeps the streamed log lively.

Bumps scr_version 1.0.54 → 1.0.55.

Context

The companion fixes for the same issue are already merged:

  • WebUI (majestic-webui [Firmware] Adding the libwebsockets package to all platforms #123): pollBack now waits for a real down-then-up reboot instead of treating any socket close as success.
  • majestic daemon: a periodic WebSocket keepalive PING on /ws/upgrade so the socket survives these silent phases (validated on hi3516ev300 hardware).

This PR is the third piece — making sysupgrade itself emit progress and not hang on time sync.

Testing

  • sh -n clean; matches the existing command -v timeout guard style.
  • Not hardware-flash-tested end-to-end (a real flash is destructive); the changes are a bounded ntpd and a curl progress flag, both low-risk. A maintainer flash on any SoC would confirm the streamed progress + no time-sync hang.

🤖 Generated with Claude Code

Two small robustness/UX fixes for the upgrade flow, both surfaced by the
WebUI's /ws/upgrade streaming (OpenIPC/majestic-webui#120):

- sync_time: `ntpd -Nnq` can block for minutes when no NTP server is
  reachable, stranding the upgrade at "Synchronizing time". Bound it with
  `timeout 30` (guarded by `command -v`, like mount_rootfs). Everything
  after this fetches via `curl -k`, so an unsynced clock is not fatal.

- download_firmware: the tgz download was fully silent (`-s ... -s`), so
  the "Download" step looked frozen for up to 2 min. Show curl's transfer
  bar (`-#`) instead; `-s` (silent_update) still opts back out for a quiet
  console run. Over /ws/upgrade this also keeps the stream lively.

Bumps scr_version to 1.0.55.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@widgetii
widgetii merged commit 7e2fc4f into master Jul 21, 2026
101 checks passed
@widgetii
widgetii deleted the fix/sysupgrade-progress-timeout branch July 21, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant