diff options
author | Jonathan Bauer | 2019-11-05 16:26:45 +0100 |
---|---|---|
committer | Jonathan Bauer | 2019-11-05 16:26:45 +0100 |
commit | f7edc034321d7dd4bec4b4ce09318c87b2824aa9 (patch) | |
tree | c0fedec82bc92dbc1cd80d5bb84fb85f30d2bf07 | |
parent | [slx-dmsetup] revert data_block_size to 256 (diff) | |
download | systemd-init-f7edc034321d7dd4bec4b4ce09318c87b2824aa9.tar.gz systemd-init-f7edc034321d7dd4bec4b4ce09318c87b2824aa9.tar.xz systemd-init-f7edc034321d7dd4bec4b4ce09318c87b2824aa9.zip |
[slx-clock] support SLX_NTP_SERVER in stage4
-rwxr-xr-x | builder/modules.d/slx-clock/module-setup.sh | 1 | ||||
-rw-r--r-- | builder/modules.d/slx-clock/scripts/configure-timesyncd.sh | 12 |
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 |