tzsetup creates a broken symlink when using with -C option (e.g make installworld DESTDIR=$X). e.g: # jexec -l 1 date Sat Sep 7 10:13:19 CEST 2024 # ls -l /jails/mail/etc/localtime lrwxr-xr-x 1 root wheel 33 Sep 7 10:13 /jails/mail/etc/localtime -> /usr/share/zoneinfo/Europe/Berlin # tzsetup -C /jails/mail -r # ls -l /jails/mail/etc/localtime lrwxr-xr-x 1 root wheel 45 Sep 7 10:14 /jails/mail/etc/localtime -> /jails/mail//usr/share/zoneinfo/Europe/Berlin # jexec -l 1 date Sat Sep 7 08:14:45 UTC 2024 Details here: https://lists.freebsd.org/archives/freebsd-current/2024-September/006355.html https://lists.freebsd.org/archives/dev-commits-src-all/2024-August/044194.html
There is some context at https://reviews.freebsd.org/D37005.
Immediate fix for the incorrect symlink at https://reviews.freebsd.org/D46725
(In reply to Ed Maste from comment #2) Thanks. So my suggested patch was almost correct. lol It works after running 'make buildworld installworld' twice. Maybe a note is required for UPDATING?
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=030c387f5d74a66d0d5950e3450d6da24237fb2e commit 030c387f5d74a66d0d5950e3450d6da24237fb2e Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-09-21 11:13:27 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-09-30 14:22:34 +0000 tzsetup: correct timezone symlink target In chroot mode tzsetup prepended the chroot path to the symlink target, which is not correct. Use the same path for the symlink regardless of chroot mode. PR: 281332 Reported by: scf, Herbert J. Skuhra Reviewed by: olce Fixes: 5e16809c953f ("tzsetup: symlink /etc/localtime instead of co...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46725 usr.sbin/tzsetup/tzsetup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Fixed: the MFC'd change was reverted from stable/14, so the bug existed only in main.