1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2026-05-03 23:18:02 +01:00

Make system timezone setting persistenly configurable (#4224)

To make system timezone configurable, we need to have /etc/localtime
writable, and it must be possible to atomically create a symlink from
this place, which means the whole parent folder must be writable. We
don't have /etc writable and can't use the usual bind mount for this.

Latest Systemd v258 has patch that allows setting an environment
variable that sets where the localtime should be written. This can be
persisted in the overlay partition, with a symlink from /etc/localtime
leading there, finally pointing to the actual zoneinfo file. If the
symlink doesn't exist, create it by hassos-overlay script (it's not
really needed as UTC is the default, but Systemd does the same if you
change from non-UTC timezone back to UTC).

Also disable BR2_TARGET_LOCALTIME, so /etc/localtime and /etc/timezone
(the latter is only informative and non-standard) are not written by the
tzdata package build.
This commit is contained in:
Jan Čermák
2025-08-13 18:15:57 +02:00
committed by GitHub
parent 69ff24a59a
commit 7243db762e
25 changed files with 971 additions and 19 deletions

View File

@@ -0,0 +1,2 @@
[Manager]
ManagerEnvironment=SYSTEMD_ETC_LOCALTIME=/mnt/overlay/etc/localtime