summaryrefslogtreecommitdiffstats
path: root/modules.d/slx-clock/module-setup.sh
blob: 8dbce9f1775466f39a350e54a2d0205ec920e79d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
check() {
	if ! hash ntpdate; then
		derror "Missing 'ntpdate'. Please install it."
		return 1
	fi
	# Tell dracut that this module should only be included if it is required
	# explicitly.
	return 255
}
depends() {
	echo dnbd3-rootfs busybox
}
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 /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"
}