Made sure there's a default config that's 'sane'

This commit is contained in:
Anton Hvornum 2021-11-02 09:29:28 +00:00
parent d7449cc887
commit 7e85002dcb
1 changed files with 6 additions and 0 deletions

View File

@ -249,6 +249,12 @@ class Installer:
def activate_ntp(self):
self.log('Installing and activating NTP.', level=logging.INFO)
self.enable_service('systemd-timesyncd'):
with open(f"{self.target}/etc/systemd/timesyncd.conf", "w") as fh:
fh.write("[Time]\n")
fh.write("NTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org\n")
fh.write("FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 0.fr.pool.ntp.org\n")
with Boot(self) as session:
session.SysCommand(["timedatectl", "set-ntp", 'true'])