ntp: Add systemd service files + ODU specific configuration

On the ODU, we have a local GPS/GNSS receiver as prefision time source.
This commit is contained in:
Harald Welte 2015-02-20 11:29:49 +01:00
parent 5de4108c11
commit d7e88c9356
2 changed files with 40 additions and 16 deletions

View File

@ -0,0 +1,19 @@
# This is the most basic ntp configuration file
# The driftfile must remain in a place specific to this
# machine - it records the machine specific clock error
driftfile /etc/ntp.drift
# This obtains a random server which will be close
# (in IP terms) to the machine. Add other servers
# as required, or change this.
server pool.ntp.org
# Using local hardware clock as fallback
# Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself
server 127.127.1.0
fudge 127.127.1.0 stratum 14
server 127.127.28.0
fudge 127.127.28.0 refid GPS
# Defining a default security setting, allowing queries but declining
# pretty much everything else
restrict default limited kod nomodify notrap nopeer

View File

@ -1,11 +1,6 @@
require ntp.inc
PR = "r5"
#inherit systemd
#SYSTEMD_PACKAGES = "${PN}-systemd"
#SYSTEMD_SERVICE_${PN}-systemd = "ntpd.service"
PR = "r6"
SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
file://tickadj.c.patch \
@ -29,21 +24,32 @@ do_install_append() {
install -d ${D}/${sysconfdir}/network/if-up.d
install -m 755 ${WORKDIR}/ntpdate ${D}/${sysconfdir}/network/if-up.d
#install -d ${D}${systemd_unitdir}/system
#install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/
#install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/
ln -sf ../ntpd.service ${D}${systemd_unitdir}/system/multi-user.target.wants/
}
#PACKAGES =+ "${PN}-systemd"
FILES_${PN}-bin = "${bindir}/ntp-wait \
${bindir}/ntpdc \
${bindir}/ntpq \
${bindir}/ntptime \
${bindir}/ntptrace"
#FILES_${PN}-systemd = "${systemd_unitdir}/system/"
#RDEPENDS_${PN}-systemd = "${PN}"
FILES_${PN} = "${bindir}/ntpd \
${sysconfdir}/ntp.conf \
${sysconfdir}/init.d/ntpd \
${systemd_unitdir}/system/ntpd.service \
${systemd_unitdir}/system/multi-user.target.wants/ntpd.service"
FILES_${PN}-bin = "${bindir}/ntp-wait ${bindir}/ntpdc ${bindir}/ntpq ${bindir}/ntptime ${bindir}/ntptrace"
FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd"
FILES_${PN}-tickadj = "${bindir}/tickadj"
FILES_ntp-utils = "${bindir}/*"
FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate"
FILES_ntpdate = "${bindir}/ntpdate \
${sysconfdir}/network/if-up.d/ntpdate \
${systemd_unitdir}/system/ntpdate.service \
${systemd_unitdir}/system/multi-user.target.wants/ntpdate.service"
# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
# with wonky clocks (e.g. OpenSlug)
@ -60,4 +66,3 @@ else
fi
fi
}