diff options
Diffstat (limited to 'recipes-support')
-rw-r--r-- | recipes-support/ntp/files/ntpd-init.patch | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/recipes-support/ntp/files/ntpd-init.patch b/recipes-support/ntp/files/ntpd-init.patch index d1c3a84..42fbbe5 100644 --- a/recipes-support/ntp/files/ntpd-init.patch +++ b/recipes-support/ntp/files/ntpd-init.patch @@ -1,6 +1,6 @@ diff -Naur old/ntpd new/ntpd --- old/ntpd 2017-02-03 10:11:28.136849640 -0600 -+++ new/ntpd 2017-02-03 13:19:42.629257684 -0600 ++++ new/ntpd 2017-02-03 10:33:58.537991855 -0600 @@ -1,6 +1,8 @@ -#! /bin/sh +#! /bin/bash @@ -11,7 +11,7 @@ diff -Naur old/ntpd new/ntpd # ntpd init.d script for ntpdc from ntp.isc.org test -x /usr/sbin/ntpd -a -r /etc/ntp.conf || exit 0 -@@ -18,13 +20,25 @@ +@@ -18,13 +20,29 @@ } } startdaemon(){ @@ -27,7 +27,11 @@ diff -Naur old/ntpd new/ntpd + if ((GPSD_REQUIRED == 1)) && [[ -L /dev/gps0 ]] && [[ -f "${GNSSRST}" ]]; then + . /etc/default/gpsd + if ((SET_SYSTEM_CLOCK == 1)) && /usr/sbin/gpsd_ubx_settime ; then -+ # System time was just set by the GPS. ++ # We just set the system time by the GPS. Should be within 2 seconds. ++ # Now that we are close to the correct system time, we ++ # use the ntpd one shot option to get to less than ++ # 250mS error so that we don't waste time adjusting the clock. ++ /usr/sbin/ntpd -gq + /usr/sbin/start-stop-daemon -N -20 --start -x /usr/sbin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@" + else + # Need a GPS fix before startint ntp. Try again later. @@ -44,7 +48,7 @@ diff -Naur old/ntpd new/ntpd } stopdaemon(){ echo -n "Stopping ntpd: " -@@ -34,24 +48,38 @@ +@@ -34,24 +52,38 @@ case "$1" in start) |