On Sat, Mar 20, 2021 at 11:37 AM Andreas K. Huettel
<dilfri...@gentoo.org> wrote:
>
> Hi all,
>
> why do we *copy* the timezone file to /etc/localtime, instead of symlinking 
> it like everyone else?
>
> 1) Our handbook recommends:
>
> echo "Europe/Brussels" > /etc/timezone
> emerge --config sys-libs/timezone-data
>
> which is effectively doing
>
> echo "Europe/Brussels" > /etc/timezone
> cp -f /usr/share/zoneinfo/Europe/Brussels /etc/localtime
>
> 2) Most other distros seem to just do
>
> ln -sf /usr/share/zoneinfo/Europe/Brussels /etc/localtime
>
> and use the link content as timezone name (this is also what is required by 
> systemd).
>
> Does anyone remember the reason for 1) ? Or is that lost in history?

I think the most obvious reason would be to support late-mounting of
/usr, after the system clock has been reset with a UTC offset on boot.
To make this work, the /etc/localtime file would need to be available
when the hwclock init script runs.

These days, I suspect there are not many users running systems with a
hardware clock in local time, and a separate /usr filesystem, and no
initramfs to mount /usr early.

I created a PR to adjust the logic in timezone-data to promote
symlinks for new installs, while keeping regular files in place for
existing users.

https://github.com/gentoo/gentoo/pull/20050

If we added some logic to detect if /usr is a separate filesystem, we
could possibly be even more aggressive about this. But I'm not sure I
want to rock the boat that much in one commit.

Reply via email to