summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2019-11-05 16:26:45 +0100
committerJonathan Bauer2019-11-05 16:26:45 +0100
commitf7edc034321d7dd4bec4b4ce09318c87b2824aa9 (patch)
treec0fedec82bc92dbc1cd80d5bb84fb85f30d2bf07
parent[slx-dmsetup] revert data_block_size to 256 (diff)
downloadsystemd-init-f7edc034321d7dd4bec4b4ce09318c87b2824aa9.tar.gz
systemd-init-f7edc034321d7dd4bec4b4ce09318c87b2824aa9.tar.xz
systemd-init-f7edc034321d7dd4bec4b4ce09318c87b2824aa9.zip
[slx-clock] support SLX_NTP_SERVER in stage4
-rwxr-xr-xbuilder/modules.d/slx-clock/module-setup.sh1
-rw-r--r--builder/modules.d/slx-clock/scripts/configure-timesyncd.sh12
2 files changed, 13 insertions, 0 deletions
diff --git a/builder/modules.d/slx-clock/module-setup.sh b/builder/modules.d/slx-clock/module-setup.sh
index 0c21b032..8fdbbef6 100755
--- a/builder/modules.d/slx-clock/module-setup.sh
+++ b/builder/modules.d/slx-clock/module-setup.sh
@@ -17,4 +17,5 @@ install() {
inst_multiple ntpdate /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/builder/modules.d/slx-clock/scripts/configure-timesyncd.sh b/builder/modules.d/slx-clock/scripts/configure-timesyncd.sh
new file mode 100644
index 00000000..af1148eb
--- /dev/null
+++ b/builder/modules.d/slx-clock/scripts/configure-timesyncd.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+. /etc/openslx
+
+if [ -n "$SLX_NTP_SERVER" ]; then
+ tsdir="${NEWROOT}/etc/systemd/timesyncd.conf.d"
+ mkdir -p "$tsdir"
+ (
+ echo "[Time]"
+ echo "NTP=$SLX_NTP_SERVER"
+ ) > "${tsdir}/slx-ntp.conf"
+fi