Add Config -> Sync net time manual trigger

The reflashed image starts chronyd at ~27 s, before NetworkManager installs
a usable resolv.conf, so pool.ntp.org stays unresolved and minpoll 12 would
wait up to 4096 s. Wi-Fi came up at ~30 s but the clock was only stepped at
~112 s, when usb0 emitted another dispatcher event.

- Config -> Sync net time in the built-in dmenu Config menu runs
  bananarchy-sync-net-time.sh, forces a burst via bananarchy-time-sync.sh
  sync and shows a desktop notification with the UTC date or a failure.
- New sync mode reports success/failure and exit status; resolved() now
  requires at least one known source, DNS waits run before the flock, and
  network-up/force/sync get 8 retries so a slow boot retry cannot swallow
  network-up events.
- Rebuilt dmenu.so from src/sxmo-dmenu/dmenu.c into prebuilt/ and overlay/;
  apply-bananarchy-overlay.sh keeps the wrapper root-owned and executable;
  check-rebuild.sh guards the menu entry, wrapper and sync mode.
- Rebuilt and verified images/bananarchy-nokia-argon.img (all new files
  byte-identical to overlay, boot.img unchanged, 27 initramfs modules).

Live verification on the reflashed phone: helper sync as the X session user
prints "Network time synced: 2026-11-07 20:17:43 UTC", the wrapper posts a
notification, a DNS-down sync fails clearly after 16 s, restoring DNS syncs
again, and the rebuilt dmenu daemon was reloaded with the new Config item.
This commit is contained in:
Luxferre committed 2026-11-07 22:22:02 +02:00
1 parent 9ac39ce6bf
commit 85c6a7b886
12 files changed
+177 -16

No files matched your search

+34
View File
@@ -9,6 +9,40 @@ Release versions follow the `<year-letter><MM><DD>` format (where `2026` is `a`,
---
## Unreleased — manual network time sync from the Config menu
- **Config -> Sync net time**: a new menu item in the built-in dmenu Config
menu (`src/sxmo-dmenu/dmenu.c`) runs
`/usr/bin/bananarchy-sync-net-time.sh`, which forces an immediate NTP burst
and shows a desktop notification with the result. It is the manual escape
hatch when boot-time autosync is slow, e.g. because Wi-Fi DNS became usable
only after `chronyd` had started with an unresolved NTP pool.
- **`bananarchy-time-sync.sh sync`**: the helper now reports
`Network time synced: <UTC date>` (or a clear failure) and returns a
matching exit status. `resolved()` now requires at least one known source,
so a freshly started chronyd with zero sources cannot be mistaken for a
resolved pool. DNS resolution runs before the `flock` is taken, so the long
boot retry no longer swallows the NetworkManager `up` / `dns-change` events
that arrive while it is waiting; network-up events get 8 retries (16 s).
- **Measured on the reflashed phone**: the kernel set the clock from the RTC
to `1970-01-12 12:39:26 UTC`; NetworkManager, chronyd and the time-sync
service started at ~27 s; Wi-Fi got its DHCP lease and `resolv.conf` at
~30 s; the first NTP samples and the clock step to `2026-11-07 20:04:23
UTC` happened only at ~112 s, when the USB RNDIS connection came up and
emitted another dispatcher event. The Wi-Fi events at ~30 s produced no
burst: the boot helper either held its `flock` for the 60 s DNS retry or had
already written its 15 s throttle stamp after treating a zero-source
`activity` report as a resolved pool.
- Live verification: a simulated DNS-down chronyd start followed by a
concurrent `network-up` trigger now syncs while the boot helper is still
waiting; the menu command was exercised as the X session user and reported
success over the root-only chronyd Unix socket.
- `scripts/check-rebuild.sh` guards the menu entry, the menu wrapper, the
`sync` mode and the overlay ownership/mode fix; `prebuilt/sxmo-x11` and
`overlay/rootfs` dmenu plugin were rebuilt from the C source.
---
## Unreleased — network-up NTP synchronisation
- **Fixed the clock never being set over the network**: `chronyd` resolves