From 8e7de51b50a2a9b25d2a37d6a73f9cf69eaa9078 Mon Sep 17 00:00:00 2001
From: Robert Nelson <robertcnelson@gmail.com>
Date: Wed, 9 May 2018 13:55:03 -0500
Subject: [PATCH] chroot: update clock before final cleanup

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
---
 scripts/chroot.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/chroot.sh b/scripts/chroot.sh
index 0e9827af6..fd7d164b7 100755
--- a/scripts/chroot.sh
+++ b/scripts/chroot.sh
@@ -1299,6 +1299,13 @@ cat > "${DIR}/cleanup_script.sh" <<-__EOF__
 			rm -rf /etc/apt/apt.conf.d/03-proxy-https || true
 		fi
 
+		#update time stamp before final cleanup...
+		if [ -f /lib/systemd/system/systemd-timesyncd.service ] ; then
+			touch /var/lib/systemd/clock
+
+			cat /etc/group | grep ^systemd-timesync && chown systemd-timesync:systemd-timesync /var/lib/systemd/clock || true
+		fi
+
 #		#This is tmpfs, clear out any left overs...
 #		if [ -d /run/ ] ; then
 #			rm -rf /run/* || true
-- 
GitLab