git: 840edcd2921e - main - sysbuild: Copy /etc/localtime as symlink

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Wed, 27 Aug 2025 21:36:10 UTC
The branch main has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=840edcd2921e755e6588a8317d8adec3302a0bfd

commit 840edcd2921e755e6588a8317d8adec3302a0bfd
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2025-08-27 21:34:40 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2025-08-27 21:35:55 +0000

    sysbuild: Copy /etc/localtime as symlink
    
    Without -P (or -R, which defaults to enabling -P) symlinks are
    dereferenced and so the target file is copied, not the symlink itself.
    
    Fixes:  5e16809c953f ("tzsetup: symlink /etc/localtime instead of copying")
---
 tools/tools/sysbuild/sysbuild.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tools/sysbuild/sysbuild.sh b/tools/tools/sysbuild/sysbuild.sh
index 7c3e21c98736..2b3edc9a45ae 100644
--- a/tools/tools/sysbuild/sysbuild.sh
+++ b/tools/tools/sysbuild/sysbuild.sh
@@ -600,7 +600,7 @@ fi
 
 if [ -f /etc/localtime ] ; then
 	log_it copy localtime
-	cp /etc/localtime ${SBMNT}/etc
+	cp -P /etc/localtime ${SBMNT}/etc
 	if [ -f /var/db/zoneinfo ] ; then
 		log_it copy zoneinfo
 		cp /var/db/zoneinfo ${SBMNT}/var/db