summaryrefslogtreecommitdiff
path: root/recipes-support/ntp
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-01-13 18:48:22 -0600
committerJohn Klug <john.klug@multitech.com>2017-01-13 18:48:22 -0600
commit823edc2d6be48e9dc2dffda2f44c8dea5b7fc1e6 (patch)
treed8a9c185c07fdc97e3aecceaf95cddc29eae570f /recipes-support/ntp
parentff32f2719b24a05c160a7110fd08745b348a23c3 (diff)
downloadmeta-mlinux-823edc2d6be48e9dc2dffda2f44c8dea5b7fc1e6.tar.gz
meta-mlinux-823edc2d6be48e9dc2dffda2f44c8dea5b7fc1e6.tar.bz2
meta-mlinux-823edc2d6be48e9dc2dffda2f44c8dea5b7fc1e6.zip
Add /etc/default/ntpd to the ntp configuration.
Diffstat (limited to 'recipes-support/ntp')
-rw-r--r--recipes-support/ntp/files/ntpd-default26
-rw-r--r--recipes-support/ntp/ntp_4.2.6p5.bbappend18
2 files changed, 44 insertions, 0 deletions
diff --git a/recipes-support/ntp/files/ntpd-default b/recipes-support/ntp/files/ntpd-default
new file mode 100644
index 0000000..85b8041
--- /dev/null
+++ b/recipes-support/ntp/files/ntpd-default
@@ -0,0 +1,26 @@
+# The GPSD_* parameters in this file are ignored
+# if the uBlox GPS is not present.
+
+# Require a GPS lock/fix before starting NTP
+# This is needed if we are not using NTP servers.
+# NTP will not work with the GPS if the GPS is not
+# locked before starting.
+GPSD_REQUIRED=1
+
+# Number of seconds to wait before checking if
+# the GPS has a lock.
+GPSD_WAIT_TIME=120
+
+# Since the HW Clock could be off by a second or
+# so, our GPS might get marked as a false ticker
+# if we do not set the system clock to the GPS
+# first. The current correct way to do this
+# according to the GPS doc is ntpd -gq
+# which must be done before ntpd is started.
+# ntpd -gq apparently does not work with the GPS
+# when tested with the clock one day off and no
+# ntpd.
+# If there is a uBlox GPS present, the time is
+# read from the GPS to initialize the system time.
+SET_SYSTEM_CLOCK=1
+
diff --git a/recipes-support/ntp/ntp_4.2.6p5.bbappend b/recipes-support/ntp/ntp_4.2.6p5.bbappend
index 7928608..b656256 100644
--- a/recipes-support/ntp/ntp_4.2.6p5.bbappend
+++ b/recipes-support/ntp/ntp_4.2.6p5.bbappend
@@ -2,6 +2,7 @@ PR .= ".mlinux1"
SRC_URI += " file://ntpd-init.patch;patchdir=.. \
file://ntp.conf.patch;patchdir=.. \
+ file://ntpd-default \
"
FILESEXTRAPATHS_prepend := "${THISDIR}/files"
@@ -26,3 +27,20 @@ pkg_postinst_${PN} () {
chown -R ntp:ntp ${drdir}
}
+
+do_install_prepend() {
+ echo JAK In do_install_append in directory $(pwd), and D is ${D}
+ echo JAK In do_install_append sysconfdir is ${sysconfdir}
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/ntpd-default ${D}${sysconfdir}/default/ntpd.default
+ echo JAK In do_install_append default is $(ls ${D}cd${sysconfdir}/default/ntpd.default)
+}
+pkg_postinst_${PN}() {
+ update-alternatives --install ${sysconfdir}/default/ntpd ntpd-defaults ${sysconfdir}/default/ntpd.default 10
+}
+
+pkg_postrm_${PN}() {
+ update-alternatives --remove ntpd-defaults ${sysconfdir}/default/ntpd.default
+}
+FILES_${PN} += "${sysconfdir}/default/ntpd.default"
+CONFFILES_${PN} += "${sysconfdir}/default/ntpd.default"