launch: seed time when the clock is before 2026-10-09 (no battery RTC)

This commit is contained in:
1okko
2026-10-10 11:56:14 +08:00
parent 9ccac0a4d5
commit 52c2df3acc
+10
View File
@@ -20,3 +20,13 @@ if [ -z "$AGNOS_VERSION" ]; then
fi
export STAGING_ROOT="/data/safe_staging"
# --- system time (this hardware has no battery-backed RTC) ---
# On a cold boot there is no sane clock: AGNOS restores a stale timestamp (or the epoch),
# which is still far earlier than the TLS certificate validity and makes the model
# list/download fail with "certificate is not yet valid". Force a known-recent date so
# TLS works immediately; NTP/GPS correct it afterwards.
if [ "$(date +%Y%m%d)" -lt 20261009 ]; then
sudo date -s "2026-10-09 12:00:00" >/dev/null 2>&1
printf 'seeded %s (was earlier than 2026-10-09)\n' "$(date -Is)" >> /data/time_seed.log 2>/dev/null
fi