From 9afe9310b108d75de86a536932c7dfd76b6c6040 Mon Sep 17 00:00:00 2001 From: Penny Zheng Date: Thu, 1 Aug 2019 14:09:14 +0800 Subject: [PATCH] chrony-service: re-patch PR#265 commit 39370c2(https://github.com/kata-containers/osbuilder/commit/ 39370c2aea6973acfc98a172b7ee084d0ea58afd) has accidentally deleted the content in PR#265(https://github.com/kata-containers/osbuilder/pull/265). Here, I just re-patch PR#265 on the latest master code. Fixes: #338 Signed-off-by: Archana Shinde Signed-off-by: Penny Zheng --- rootfs-builder/rootfs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rootfs-builder/rootfs.sh b/rootfs-builder/rootfs.sh index cc410035f..6acdb4b5d 100755 --- a/rootfs-builder/rootfs.sh +++ b/rootfs-builder/rootfs.sh @@ -468,6 +468,15 @@ EOT # Reference: https://chrony.tuxfamily.org/doc/3.4/chrony.conf.html sed -i 's/^\(server \|pool \|peer \)/# &/g' ${chrony_conf_file} + chrony_systemd_service="${ROOTFS_DIR}/usr/lib/systemd/system/chronyd.service" + if [ ${distro} == ubuntu ] || [ ${distro} == debian ] ; then + chrony_systemd_service="${ROOTFS_DIR}/lib/systemd/system/chrony.service" + fi + + if [ -f "$chrony_systemd_service" ]; then + sed -i '/^\[Unit\]/a ConditionPathExists=\/dev\/ptp0' ${chrony_systemd_service} + fi + # The CC on s390x for fedora needs to be manually set to gcc when the golang is downloaded from the main page. # See issue: https://github.com/kata-containers/osbuilder/issues/217 [ "$distro" == "fedora" ] && [ "$ARCH" == "s390x" ] && export CC=gcc