From 52c2df3accd14d89c61427df968d8f6207db56fc Mon Sep 17 00:00:00 2001 From: 1okko <15377594951@189.cn> Date: Sat, 10 Oct 2026 11:56:14 +0800 Subject: [PATCH] launch: seed time when the clock is before 2026-10-09 (no battery RTC) --- launch_env.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/launch_env.sh b/launch_env.sh index f29c6fe01..2def424b8 100755 --- a/launch_env.sh +++ b/launch_env.sh @@ -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