From d7e88c935630b9e3bbbf1a2420ae6049e9baf1be Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 20 Feb 2015 11:29:49 +0100 Subject: [PATCH] ntp: Add systemd service files + ODU specific configuration On the ODU, we have a local GPS/GNSS receiver as prefision time source. --- recipes-bsp/ntp/files/sob-odu/ntp.conf | 19 +++++++++++++ recipes-bsp/ntp/ntp_4.2.6p3.bb | 37 +++++++++++++++----------- 2 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 recipes-bsp/ntp/files/sob-odu/ntp.conf diff --git a/recipes-bsp/ntp/files/sob-odu/ntp.conf b/recipes-bsp/ntp/files/sob-odu/ntp.conf new file mode 100644 index 0000000..e344078 --- /dev/null +++ b/recipes-bsp/ntp/files/sob-odu/ntp.conf @@ -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 diff --git a/recipes-bsp/ntp/ntp_4.2.6p3.bb b/recipes-bsp/ntp/ntp_4.2.6p3.bb index 487a28c..fd2fab5 100644 --- a/recipes-bsp/ntp/ntp_4.2.6p3.bb +++ b/recipes-bsp/ntp/ntp_4.2.6p3.bb @@ -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 } -