Files
bananarchy/overlay/rootfs/usr/bin/bananarchy-sync-net-time.sh
T
Luxferre 85c6a7b886 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.
2026-11-07 22:22:02 +02:00

24 lines
625 B
Bash
Executable File

#!/bin/sh
# Config -> Sync net time: force an immediate NTP sync and show the outcome.
# Runs as the X session user; bananarchy-time-sync.sh escalates via doas.
set -u
result="$(/usr/bin/bananarchy-time-sync.sh sync 2>&1)"
[ -n "$result" ] || result="No response from chronyd"
case "$result" in
"Network time synced"*)
urgency=normal
;;
*)
urgency=critical
;;
esac
if command -v notify-send >/dev/null 2>&1; then
notify-send --urgency="$urgency" --expire-time=8000 \
"Sync net time" "$result" >/dev/null 2>&1 || true
else
sxmo_notify_user.sh "Sync net time: $result" >/dev/null 2>&1 || true
fi