summaryrefslogtreecommitdiff
path: root/recipes-support
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2016-12-21 09:15:47 -0600
committerJohn Klug <john.klug@multitech.com>2016-12-21 09:15:47 -0600
commit0d53f1437fcdbae1c1b112b9892be8994cef3834 (patch)
tree2cf46a12b25f6b7d2fd1e080cc9b8d47300e1407 /recipes-support
parent12465c3b11e4a7517a92480980f1ce2f8a877e71 (diff)
parent2ba73a35c4907336858320b31ce515a6aa10698f (diff)
downloadmeta-mlinux-0d53f1437fcdbae1c1b112b9892be8994cef3834.tar.gz
meta-mlinux-0d53f1437fcdbae1c1b112b9892be8994cef3834.tar.bz2
meta-mlinux-0d53f1437fcdbae1c1b112b9892be8994cef3834.zip
Change priority of gpsd and add multitech GPS device to default.
Diffstat (limited to 'recipes-support')
-rw-r--r--recipes-support/ntp/files/ntp.conf.patch53
-rw-r--r--recipes-support/ntp/files/ntpd-init.patch11
-rw-r--r--recipes-support/ntp/ntp_4.2.6p5.bbappend26
3 files changed, 90 insertions, 0 deletions
diff --git a/recipes-support/ntp/files/ntp.conf.patch b/recipes-support/ntp/files/ntp.conf.patch
new file mode 100644
index 0000000..499dac5
--- /dev/null
+++ b/recipes-support/ntp/files/ntp.conf.patch
@@ -0,0 +1,53 @@
+diff -u old/ntp.conf new/ntp.conf
+--- old/ntp.conf 2016-12-21 08:36:33.887646960 -0600
++++ new/ntp.conf 2016-12-21 08:37:41.115645756 -0600
+@@ -1,7 +1,20 @@
+-# 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
++# Driftfile must be in a directory owned by ntp
++driftfile /var/lib/ntp/ntp.drift
++
++# The following code is for evaluating the timeserver.
++# Remove the # to activate the statistics
++# statistics loopstats
++# statistics peerstats
++# statsdir /var/log/ntpstats
++# filegen peerstats file peerstats type day link enable
++# filegen loopstats file loopstats type day link enable
++
++# This is the US timeserver pool. You should use a pool
++# close to your location.
++#pool us.pool.ntp.org iburst
++
+ # This should be a server that is close (in IP terms)
+ # to the machine. Add other servers as required.
+ # Unless you un-comment the line below ntpd will sync
+@@ -9,8 +22,26 @@
+ #
+ # server time.server.example.com
+ #
++
++logfile /var/log/ntp.log
++
++restrict default kod nomodify notrap nopeer noquery
++restrict -6 default kod nomodify notrap nopeer noquery
++restrict 127.0.0.1 mask 255.255.255.0
++restrict -6 ::1
++
++# GPS Serial data reference (NTP0)
++server 127.127.28.0
++fudge 127.127.28.0 time1 0.080 refid GPS
++
++# GPS PPS reference (NTP2)
++server 127.127.28.2 prefer
++fudge 127.127.28.2 time1 0.000 refid PPS
++
+ # Using local hardware clock as fallback
+ # Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself
++# The stratum should be a high value so this does not get chosen
++# except in dire circumstances.
+ server 127.127.1.0
+ fudge 127.127.1.0 stratum 14
+ # Defining a default security setting
diff --git a/recipes-support/ntp/files/ntpd-init.patch b/recipes-support/ntp/files/ntpd-init.patch
new file mode 100644
index 0000000..fc388f8
--- /dev/null
+++ b/recipes-support/ntp/files/ntpd-init.patch
@@ -0,0 +1,11 @@
+--- old/ntpd 2016-12-19 18:11:58.022663976 -0600
++++ new/ntpd 2016-12-19 18:12:56.618663852 -0600
+@@ -23,7 +23,7 @@
+ # this. If ntpd seems to disappear after a while assume TICKADJ
+ # above is set to a totally incorrect value.
+ echo -n "Starting ntpd: "
+- start-stop-daemon --start -x /usr/sbin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@"
++ start-stop-daemon -N -20 --start -x /usr/sbin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@"
+ echo "done"
+ }
+ stopdaemon(){
diff --git a/recipes-support/ntp/ntp_4.2.6p5.bbappend b/recipes-support/ntp/ntp_4.2.6p5.bbappend
new file mode 100644
index 0000000..4651611
--- /dev/null
+++ b/recipes-support/ntp/ntp_4.2.6p5.bbappend
@@ -0,0 +1,26 @@
+PR .= ".mlinux1"
+
+SRC_URI += " file://ntpd-init.patch;patchdir=.. \
+ file://ntp.conf.patch;patchdir=.. \
+ "
+FILESEXTRAPATHS_prepend := "${THISDIR}/files"
+
+python do_patch_prepend () {
+ import os
+}
+pkg_postinst_${PN} () {
+ if ! [[ -d /var/log/ntpstats ]] ; then
+ mkdir -p /var/log/ntpstats
+ fi
+ chown ntp:ntp /var/log/ntpstats
+ chmod 775 /var/log/ntpstats
+
+ if ! [[ -d /var/lib/ntp ]] ; then
+ mkdir -p /var/lib/ntp
+ fi
+ drfile="/var/lib/ntp/ntp.drift"
+ touch ${drfile}
+ chown ntp:ntp ${drfile}
+ chmod 664 ${drfile}
+}
+