From 889db6019ddcae8b2b3c60149a257a00a7256a23 Mon Sep 17 00:00:00 2001 From: Florent CARLI Date: Thu, 9 Jan 2025 10:23:52 +0100 Subject: [PATCH] VM: preconfigure ptp_kvm Signed-off-by: Florent CARLI --- .../etc/chrony/conf.d/ptp.conf/SEAPATH_VM | 1 + .../modules-load.d/ptp_kvm.conf/SEAPATH_VM | 1 + .../etc/systemd/resolved.conf/SEAPATH_VM | 34 +++++++++++++++++++ srv_fai_config/scripts/SEAPATH_VM/10-chrony | 10 ++++++ 4 files changed, 46 insertions(+) create mode 100644 srv_fai_config/files/etc/chrony/conf.d/ptp.conf/SEAPATH_VM create mode 100644 srv_fai_config/files/etc/modules-load.d/ptp_kvm.conf/SEAPATH_VM create mode 100644 srv_fai_config/files/etc/systemd/resolved.conf/SEAPATH_VM create mode 100755 srv_fai_config/scripts/SEAPATH_VM/10-chrony diff --git a/srv_fai_config/files/etc/chrony/conf.d/ptp.conf/SEAPATH_VM b/srv_fai_config/files/etc/chrony/conf.d/ptp.conf/SEAPATH_VM new file mode 100644 index 0000000..e7210cb --- /dev/null +++ b/srv_fai_config/files/etc/chrony/conf.d/ptp.conf/SEAPATH_VM @@ -0,0 +1 @@ +refclock PHC /dev/ptp0 poll 2 diff --git a/srv_fai_config/files/etc/modules-load.d/ptp_kvm.conf/SEAPATH_VM b/srv_fai_config/files/etc/modules-load.d/ptp_kvm.conf/SEAPATH_VM new file mode 100644 index 0000000..17423dc --- /dev/null +++ b/srv_fai_config/files/etc/modules-load.d/ptp_kvm.conf/SEAPATH_VM @@ -0,0 +1 @@ +ptp_kvm diff --git a/srv_fai_config/files/etc/systemd/resolved.conf/SEAPATH_VM b/srv_fai_config/files/etc/systemd/resolved.conf/SEAPATH_VM new file mode 100644 index 0000000..d012e3a --- /dev/null +++ b/srv_fai_config/files/etc/systemd/resolved.conf/SEAPATH_VM @@ -0,0 +1,34 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Entries in this file show the compile time defaults. Local configuration +# should be created by either modifying this file, or by creating "drop-ins" in +# the resolved.conf.d/ subdirectory. The latter is generally recommended. +# Defaults can be restored by simply deleting this file and all drop-ins. +# +# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config. +# +# See resolved.conf(5) for details. + +[Resolve] +# Some examples of DNS servers which may be used for DNS= and FallbackDNS=: +# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com +# Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google +# Quad9: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net +DNS=8.8.8.8 4.4.4.4 +#FallbackDNS= +#Domains= +#DNSSEC=no +#DNSOverTLS=no +#MulticastDNS=yes +LLMNR=no +#Cache=yes +#CacheFromLocalhost=no +#DNSStubListener=yes +#DNSStubListenerExtra= +#ReadEtcHosts=yes +#ResolveUnicastSingleLabel=no diff --git a/srv_fai_config/scripts/SEAPATH_VM/10-chrony b/srv_fai_config/scripts/SEAPATH_VM/10-chrony new file mode 100755 index 0000000..4fcbd65 --- /dev/null +++ b/srv_fai_config/scripts/SEAPATH_VM/10-chrony @@ -0,0 +1,10 @@ +#!/bin/bash + +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code + +fcopy -M /etc/modules-load.d/ptp_kvm.conf +fcopy -M /etc/chrony/conf.d/ptp.conf +fcopy -M /etc/systemd/resolved.conf + +$ROOTCMD systemctl enable chrony +$ROOTCMD systemctl enable systemd-resolved