Skip to content

Pass the host timezone into the container so TPV's HUD clock is local - #10

Merged
BenA-SA merged 3 commits into
masterfrom
fix/host-timezone
Sep 17, 2026
Merged

BenA-SA merged 3 commits into
masterfrom
fix/host-timezone

Conversation

@BenA-SA

@BenA-SA BenA-SA commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

TPV's HUD clock showed UTC instead of local time: an hour behind on a Europe/London host during BST (#2). The container never received the host's zone, and Wine derives the Windows time zone from the Linux one.

Changes

  • run-tpv.sh: passes TZ (an explicit TZ=... override, else timedatectl's zone) and bind-mounts /etc/localtime read-only.
  • scripts/entrypoint.sh: sync_timezone records TZ plus a checksum of /etc/localtime in a marker file in the prefix. When that changes, it runs wineboot -u once. A prefix created under UTC keeps an empty TimeZoneKeyName until Wine updates the prefix, even when the container clock is already right.
  • README: TZ added to the env var table.
  • ADR-0003: options considered and the prefix-refresh finding.

Testing

  • ⏳ Not yet verified in this PR: the HUD matching host local time (including BST/GMT), and TZ=... overriding the detected zone. The image currently soak-testing on the laptop (tpv-full:mesa26) predates this change.
  • After merging: rebuild, start with ./run-tpv.sh, and check the ==> timezone: Europe/London line, the one-off timezone changed ... updating the Wine prefix on first start, and the HUD clock.

Closes #2

🤖 Generated with Claude Code

BenA-SA and others added 3 commits September 17, 2026 09:43
run-tpv.sh passes TZ (from timedatectl, or an explicit TZ override) and
bind-mounts /etc/localtime. The entrypoint runs wineboot -u once whenever the
zone changes: a prefix created under UTC keeps an empty TimeZoneKeyName until
Wine updates the prefix, even though the clock itself is already correct.

Refs #2
Refs #2

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@BenA-SA

BenA-SA commented Sep 17, 2026

Copy link
Copy Markdown
Owner Author

Tested on top of master with #12 merged: tpv-full:pr10, built from a local merge of this branch onto 7f6fa3f, started with run-tpv.sh tpv.

  • Launch output: ==> timezone: Europe/London, followed by the one-off ==> timezone changed (Europe/London); updating the Wine prefix
  • Inside the container: TZ=Europe/London, and date gives Thu Sep 17 14:15:24 BST 2026
  • HUD clock showed local BST time (confirmed by eye)
  • Marker written: wineprefix/.tpv-timezone = Europe/London:<cksum>, so later starts skip wineboot -u

Not tested: overriding with TZ=....

@BenA-SA
BenA-SA merged commit 49f9129 into master Sep 17, 2026
@BenA-SA
BenA-SA deleted the fix/host-timezone branch September 20, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HUD clock shows UTC: pass the host timezone into the container

1 participant