Sync network time when a connection comes up

This commit is contained in:
Luxferre committed 2026-11-07 21:53:07 +02:00
1 parent 38d54f10ff
commit 9ac39ce6bf
13 files changed
+365 -8

No files matched your search

+28
View File
@@ -179,6 +179,34 @@ if ! grep -q 'MODULES_INITFS' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh" ||
fail "apply-bananarchy-overlay.sh no longer installs the device initramfs module list"
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/etc/init.d/bananarchy-time-sync \
overlay/rootfs/etc/NetworkManager/dispatcher.d/20-bananarchy-time-sync.sh; do
if [ ! -f "$BASE_DIR/$f" ]; then
fail "missing $f"
fi
done
for f in overlay/rootfs/usr/bin/bananarchy-time-sync.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 '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"
fi
if ! grep -q 'bananarchy-time-sync' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh" || \
! grep -q 'var/lib/chrony' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then
fail "overlay no longer enables the time-sync service and chrony driftfile owner"
fi
if ! grep -q 'var/lib/chrony' "$BASE_DIR/rebuild-image.sh"; then
fail "rebuild-image.sh no longer fixes chrony driftfile ownership"
fi
echo "[check] Docker availability..."
if ! command -v docker >/dev/null 2>&1; then
fail "docker is not installed"