From 6eaaa711ad729b3cc244f0c97e4f901172db84f0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 24 Jan 2023 15:33:38 +0100 Subject: [slx-clock] Use ntpd, as ntpdate uses ntpdig, which is written in python We don't want python in our init, it's bloated enough already... --- modules.d/slx-clock/module-setup.sh | 4 +--- modules.d/slx-clock/scripts/ntp-sync.sh | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules.d/slx-clock/module-setup.sh b/modules.d/slx-clock/module-setup.sh index 8dbce9f1..12533363 100755 --- a/modules.d/slx-clock/module-setup.sh +++ b/modules.d/slx-clock/module-setup.sh @@ -14,9 +14,7 @@ depends() { install() { # wait til we have the openslx config for ntp servers # which happens in pre-mount/10 - inst_multiple ntpdate /etc/services /usr/share/zoneinfo/Europe/Berlin - # Needed on newer systems, where ntpdate is just a wrapper around it - inst_multiple -o ntpdig + inst_multiple /etc/services /usr/share/zoneinfo/Europe/Berlin inst /usr/share/zoneinfo/Europe/Berlin /etc/localtime inst_hook pre-mount 15 "$moddir/scripts/ntp-sync.sh" inst_hook pre-pivot 15 "$moddir/scripts/configure-timesyncd.sh" diff --git a/modules.d/slx-clock/scripts/ntp-sync.sh b/modules.d/slx-clock/scripts/ntp-sync.sh index d9c0e7bc..81b4b5a3 100755 --- a/modules.d/slx-clock/scripts/ntp-sync.sh +++ b/modules.d/slx-clock/scripts/ntp-sync.sh @@ -12,7 +12,7 @@ ntp_sync() { done local SUCCESS= for SERVER in $SLX_DHCP_NTP; do - if ntpdate -u "$SERVER"; then + if timeout 3 ntpd -q -n -p "$SERVER"; then echo "Successfully queried $SERVER for time." if [ "x$SLX_BIOS_CLOCK" = "xlocal" ]; then usleep 100000 -- cgit v1.2.3-55-g7522