diff options
Diffstat (limited to 'recipes-support/ntp/files/ntpd-init.patch')
| -rw-r--r-- | recipes-support/ntp/files/ntpd-init.patch | 31 | 
1 files changed, 26 insertions, 5 deletions
| diff --git a/recipes-support/ntp/files/ntpd-init.patch b/recipes-support/ntp/files/ntpd-init.patch index e3107e1..3f8129a 100644 --- a/recipes-support/ntp/files/ntpd-init.patch +++ b/recipes-support/ntp/files/ntpd-init.patch @@ -1,6 +1,6 @@  diff -Naru orig/ntpd new/ntpd ---- orig/ntpd	2019-03-18 10:49:41.255374972 -0500 -+++ new/ntpd	2019-03-18 11:36:56.635291031 -0500 +--- orig/ntpd	2019-12-20 15:28:43.002031942 -0600 ++++ new/ntpd	2019-12-20 15:32:59.138024359 -0600  @@ -1,4 +1,4 @@  -#! /bin/sh  +#! /bin/bash @@ -17,7 +17,28 @@ diff -Naru orig/ntpd new/ntpd   DAEMON=/usr/sbin/ntpd   PIDFILE=/var/run/ntpd.pid -@@ -34,13 +36,40 @@ +@@ -22,6 +24,20 @@ +  + # Source function library. + . /etc/init.d/functions ++has_gps=0 ++if [[ -f /sys/devices/platform/mts-io/capability/gps ]] ; then ++	has_gps=$(cat /sys/devices/platform/mts-io/capability/gps) ++fi ++ ++if (( has_gps == 0 )) ; then ++	if [[ -n ${CONFIGFILE_sha256} ]] ; then ++		NEWCONFIGFILE_sha256=$(sha256sum $CONFIGFILE) ++		if [[ $NEWCONFIGFILE_sha256 =~ $CONFIGFILE_sha256 ]] ; then ++			logger -p daemon.notice -s -t etc_ntpd "No GPS, need to configure /etc/ntp.conf" ++			exit 0 ++		fi ++	fi ++fi +  + # Functions to do individual actions + settick(){ +@@ -34,13 +50,40 @@   	}   }   startdaemon(){ @@ -30,7 +51,7 @@ diff -Naru orig/ntpd new/ntpd  -	echo "done"  +	/usr/sbin/start-stop-daemon -N -20 --start -x /usr/sbin/ntpd --test -- -u ntp:ntp -p /var/run/ntp.pid "$@" \  +	  || return 1 -+	if [[ -x /usr/sbin/gpsd_settime ]] && ((GPSD_REQUIRED == 1)) && (( $(/usr/sbin/mts-io-sysfs show capability/gps) == 1 )) && [[ -f "${GNSSRST}" ]]; then ++	if [[ -x /usr/sbin/gpsd_settime ]] && ((GPSD_REQUIRED == 1)) && (( has_gps == 1 )) && [[ -f "${GNSSRST}" ]]; then  +		. /etc/default/gpsd  +                [[ ${VERBOSE} != no ]] && logger -t 'etc_ntpd' -p daemon.info 'Have a GPS and it is required'  +		if ((SET_SYSTEM_CLOCK == 1)) && /usr/sbin/gpsd_settime ; then @@ -65,7 +86,7 @@ diff -Naru orig/ntpd new/ntpd   }   stopdaemon(){   	echo -n "Stopping ntpd: " -@@ -50,8 +79,22 @@ +@@ -50,8 +93,22 @@   case "$1" in     start) | 
