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:
1 parent
9ac39ce6bf
commit
85c6a7b886
12 files changed
+177
-16
No files matched your search
@@ -115,11 +115,13 @@ chmod 640 "$TARGET_ROOTFS/etc/doas.d/50-sxmo.conf" 2>/dev/null || true
|
||||
# driftfile (rebuild-image.sh re-applies this after normalising all UIDs).
|
||||
chown 0:0 "$TARGET_ROOTFS/etc/chrony/chrony.conf" \
|
||||
"$TARGET_ROOTFS/usr/bin/bananarchy-time-sync.sh" \
|
||||
"$TARGET_ROOTFS/usr/bin/bananarchy-sync-net-time.sh" \
|
||||
"$TARGET_ROOTFS/etc/init.d/bananarchy-time-sync" \
|
||||
"$TARGET_ROOTFS/etc/NetworkManager/dispatcher.d/20-bananarchy-time-sync.sh" \
|
||||
2>/dev/null || true
|
||||
chmod 0644 "$TARGET_ROOTFS/etc/chrony/chrony.conf" 2>/dev/null || true
|
||||
chmod 0755 "$TARGET_ROOTFS/usr/bin/bananarchy-time-sync.sh" \
|
||||
"$TARGET_ROOTFS/usr/bin/bananarchy-sync-net-time.sh" \
|
||||
"$TARGET_ROOTFS/etc/init.d/bananarchy-time-sync" \
|
||||
"$TARGET_ROOTFS/etc/NetworkManager/dispatcher.d/20-bananarchy-time-sync.sh" \
|
||||
2>/dev/null || true
|
||||
|
||||
@@ -182,6 +182,7 @@ fi
|
||||
echo "[check] Network time synchronisation..."
|
||||
for f in overlay/rootfs/etc/chrony/chrony.conf \
|
||||
overlay/rootfs/usr/bin/bananarchy-time-sync.sh \
|
||||
overlay/rootfs/usr/bin/bananarchy-sync-net-time.sh \
|
||||
overlay/rootfs/etc/init.d/bananarchy-time-sync \
|
||||
overlay/rootfs/etc/NetworkManager/dispatcher.d/20-bananarchy-time-sync.sh; do
|
||||
if [ ! -f "$BASE_DIR/$f" ]; then
|
||||
@@ -189,12 +190,21 @@ for f in overlay/rootfs/etc/chrony/chrony.conf \
|
||||
fi
|
||||
done
|
||||
for f in overlay/rootfs/usr/bin/bananarchy-time-sync.sh \
|
||||
overlay/rootfs/usr/bin/bananarchy-sync-net-time.sh \
|
||||
overlay/rootfs/etc/init.d/bananarchy-time-sync \
|
||||
overlay/rootfs/etc/NetworkManager/dispatcher.d/20-bananarchy-time-sync.sh; do
|
||||
if [ -f "$BASE_DIR/$f" ] && ! sh -n "$BASE_DIR/$f" 2>/dev/null; then
|
||||
fail "shell syntax: $f"
|
||||
fi
|
||||
done
|
||||
if ! grep -q 'Sync net time' "$BASE_DIR/src/sxmo-dmenu/dmenu.c" || \
|
||||
! grep -q 'bananarchy-sync-net-time.sh' "$BASE_DIR/src/sxmo-dmenu/dmenu.c"; then
|
||||
fail "Config menu no longer offers Sync net time"
|
||||
fi
|
||||
if ! grep -q 'sync_now' "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-time-sync.sh" || \
|
||||
! grep -q 'bananarchy-sync-net-time.sh' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then
|
||||
fail "manual network time sync is no longer installed"
|
||||
fi
|
||||
if ! grep -q 'iburst' "$BASE_DIR/overlay/rootfs/etc/chrony/chrony.conf" || \
|
||||
! grep -q 'cmdport 0' "$BASE_DIR/overlay/rootfs/etc/chrony/chrony.conf"; then
|
||||
fail "chrony.conf must keep iburst and the closed UDP command port"
|
||||
|
||||
Reference in new issue
Block a user