summaryrefslogtreecommitdiff
path: root/recipes-support/ntp/files/ntpd-init.patch
diff options
context:
space:
mode:
authorMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2020-02-19 15:40:44 +0200
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-21 10:40:11 +0300
commit19ca401463153a7694a320f543852412d74cbd8f (patch)
treee3720d485786f1f2fc78c909fc2ad2f97829ab8d /recipes-support/ntp/files/ntpd-init.patch
parented016261befcdc421ae1ac5d28d21066b56f42f2 (diff)
parent92cbb8fb30c624d3be98d6408d6ff7f03264a2c9 (diff)
downloadmeta-mlinux-atmel-19ca401463153a7694a320f543852412d74cbd8f.tar.gz
meta-mlinux-atmel-19ca401463153a7694a320f543852412d74cbd8f.tar.bz2
meta-mlinux-atmel-19ca401463153a7694a320f543852412d74cbd8f.zip
mpower-dev-thud: merge meta-mlinux:master (92cbb8fb Feb 11 2020) to meta-mlinux:multiarch5-thud (ed01626 Feb 3 2020)
Diffstat (limited to 'recipes-support/ntp/files/ntpd-init.patch')
-rw-r--r--recipes-support/ntp/files/ntpd-init.patch31
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)