Re: git: fc43a1b6842a - stable/14 - tzsetup: symlink /etc/localtime instead of copying

From: Sean C. Farley <scf_at_FreeBSD.org>
Date: Thu, 08 Aug 2024 04:35:38 UTC
On Thu, 1 Aug 2024, Ed Maste wrote:

> The branch stable/14 has been updated by emaste:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=fc43a1b6842afa806dfd7ba48de5bece63d04456
>
> commit fc43a1b6842afa806dfd7ba48de5bece63d04456
> Author:     Ed Maste <emaste@FreeBSD.org>
> AuthorDate: 2022-10-14 16:44:35 +0000
> Commit:     Ed Maste <emaste@FreeBSD.org>
> CommitDate: 2024-08-01 15:11:45 +0000
>
>    tzsetup: symlink /etc/localtime instead of copying
>
>    Using a symlink means that new timezone data (installed by an errata
>    update, say) will be usable without having to be copied again.
>
>    Reviewed by:    bapt, kevans, philip
>    Sponsored by:   The FreeBSD Foundation
>    Differential Revision: https://reviews.freebsd.org/D37005
>
>    (cherry picked from commit 5e16809c953f4cd19fadb1767469dec319de0353)

I ran across an issue with this when using "etcupdate -D" to update a 
jail from the host.  "tzsetup -r -C /tmp/chroot", as called by 
etcupdate, prepends the path of the chroot to the link which breaks 
things inside the jail.

For example, if you run the following:
mkdir -p /tmp/chroot/etc
mkdir -p /tmp/chroot/usr/share
mkdir -p /tmp/chroot/var/db
ln -s /usr/share/misc /tmp/chroot/usr/share/misc
ln -s /usr/share/zoneinfo /tmp/chroot/usr/share/zoneinfo
cp /var/db/zoneinfo /tmp/chroot/var/db/.
tzsetup -C /tmp/chroot -r

The result will be the following:
/tmp/chroot/etc/localtime@ -> /tmp/chroot//usr/share/zoneinfo/America/Indiana/Indianapolis

Sean
-- 
scf@FreeBSD.org