Skip to content

Commit

Permalink
Merge pull request kata-containers#265 from amshinde/configure-chrony…
Browse files Browse the repository at this point in the history
…-systemd

chrony: Configure chrony to start only when /dev/ptp0 exists.
  • Loading branch information
jcvenegas authored Jun 21, 2019
2 parents 434418c + d2e80f5 commit 0e0e74b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rootfs-builder/rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,15 @@ echo "refclock PHC /dev/ptp0 poll 3 dpoll -2 offset 0" >> ${chrony_conf_file}
# 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
Expand Down

0 comments on commit 0e0e74b

Please sign in to comment.