Fix GPS modem selection and add a GPS-only time source

This commit is contained in:
Luxferre committed 2026-11-10 13:18:14 +02:00
1 parent eaf08abcd4
commit a50c01b416
18 files changed
+682 -16

No files matched your search

+48
View File
@@ -1205,6 +1205,54 @@ if [ -x "$BASE_DIR/scripts/test-battery-charge-event.py" ] && \
fail "host charger plug/unplug event test failed"
fi
echo "[check] GPS-only time source..."
GPS_TIME="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-gps-time-sync.sh"
GPS_MODEM="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-gps-modem.sh"
GPS_WRAPPER="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-sync-gps-time.sh"
GPS_CLI="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-gps"
GPS_SRC="$BASE_DIR/src/dwm-plugins/gps_plugin.cpp"
DMENU_SRC="$BASE_DIR/src/sxmo-dmenu/dmenu.c"
for f in "$GPS_TIME" "$GPS_MODEM" "$GPS_WRAPPER" "$GPS_CLI" \
"$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-time-sync.sh"; do
if [ ! -x "$f" ]; then
fail "${f#$BASE_DIR/} is missing or not executable"
fi
if ! sh -n "$f" 2>/dev/null; then
fail "shell syntax: ${f#$BASE_DIR/}"
fi
done
for token in 'bananarchy-gps-modem.sh' 'gpsModemArg' \
'--location-enable-3gpp'; do
if ! grep -qF -- "$token" "$GPS_SRC"; then
fail "gps_plugin.cpp is missing the GPS modem fix: $token"
fi
done
for token in 'Sync GPS time' '@toggle:time_source' 'read_time_source'; do
if ! grep -qF "$token" "$DMENU_SRC"; then
fail "dmenu.c is missing the GPS time source option: $token"
fi
done
if ! grep -qF 'GPS is the sole time source' \
"$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-time-sync.sh"; then
fail "network time helper no longer honours the GPS-only source"
fi
if ! strings "$BASE_DIR/prebuilt/sxmo-x11/usr/lib/dwm/plugins/gps.so" 2>/dev/null | \
grep -qF 'bananarchy-gps-modem.sh'; then
fail "shipped gps.so is stale: rebuild with scripts/build-sxmo-x11.sh"
fi
if ! strings "$BASE_DIR/prebuilt/sxmo-x11/usr/lib/dwm/plugins/dmenu.so" 2>/dev/null | \
grep -qF 'Sync GPS time'; then
fail "shipped dmenu.so is stale: rebuild with scripts/build-sxmo-x11.sh"
fi
if ! grep -q 'bananarchy-gps-time-sync.sh' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then
fail "apply-bananarchy-overlay.sh no longer installs the GPS time helper"
fi
if [ -x "$BASE_DIR/scripts/test-gps-time-sync.py" ] && \
command -v python3 >/dev/null 2>&1 && \
! "$BASE_DIR/scripts/test-gps-time-sync.py" >/dev/null 2>&1; then
fail "host GPS-only time source test failed"
fi
if [ "$FAILURES" -ne 0 ]; then
echo "[check] $FAILURES check(s) failed."
exit 1